/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'drds.ap-southeast-1.aliyuncs.com',
    'ap-northeast-2-pop' = 'drds.ap-southeast-1.aliyuncs.com',
    'ap-south-1' = 'drds.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'drds.ap-southeast-1.aliyuncs.com',
    'ap-southeast-3' = 'drds.ap-southeast-1.aliyuncs.com',
    'ap-southeast-5' = 'drds.ap-southeast-1.aliyuncs.com',
    'cn-beijing-finance-1' = 'drds.aliyuncs.com',
    'cn-beijing-finance-pop' = 'drds.aliyuncs.com',
    'cn-beijing-gov-1' = 'drds.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'drds.aliyuncs.com',
    'cn-chengdu' = 'drds.aliyuncs.com',
    'cn-edge-1' = 'drds.aliyuncs.com',
    'cn-fujian' = 'drds.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'drds.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'drds.aliyuncs.com',
    'cn-hangzhou-finance' = 'drds.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'drds.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'drds.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'drds.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'drds.aliyuncs.com',
    'cn-hangzhou-test-306' = 'drds.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'drds.aliyuncs.com',
    'cn-qingdao-nebula' = 'drds.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'drds.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'drds.aliyuncs.com',
    'cn-shanghai-inner' = 'drds.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'drds.aliyuncs.com',
    'cn-shenzhen-inner' = 'drds.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'drds.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'drds.aliyuncs.com',
    'cn-wuhan' = 'drds.aliyuncs.com',
    'cn-yushanfang' = 'drds.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'drds.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'drds.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'drds.aliyuncs.com',
    'eu-central-1' = 'drds.ap-southeast-1.aliyuncs.com',
    'eu-west-1' = 'drds.ap-southeast-1.aliyuncs.com',
    'eu-west-1-oxs' = 'drds.ap-southeast-1.aliyuncs.com',
    'me-east-1' = 'drds.ap-southeast-1.aliyuncs.com',
    'rus-west-1-pop' = 'drds.ap-southeast-1.aliyuncs.com',
    'us-west-1' = 'drds.ap-southeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('drds', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangeAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The name of the member account.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds********'),
  password?: string(name='Password', description='The new password.

This parameter is required.', example='test'),
}

model ChangeAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ChangeAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeAccountPasswordResponseBody(name='body'),
}

/**
 * @param request ChangeAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeAccountPasswordResponse
 */
async function changeAccountPasswordWithOptions(request: ChangeAccountPasswordRequest, runtime: $RuntimeOptions): ChangeAccountPasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeAccountPassword',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ChangeAccountPasswordRequest
 * @return ChangeAccountPasswordResponse
 */
async function changeAccountPassword(request: ChangeAccountPasswordRequest): ChangeAccountPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return changeAccountPasswordWithOptions(request, runtime);
}

model ChangeInstanceAzoneRequest {
  changeVSwitch?: boolean(name='ChangeVSwitch'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdsjiii1b49****'),
  drdsRegionId?: string(name='DrdsRegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
  newVSwitch?: string(name='NewVSwitch'),
  originAzoneId?: string(name='OriginAzoneId', description='The source zone of the PolarDB-X 1.0 instance.

This parameter is required.', example='cn-hangzhou-B'),
  targetAzoneId?: string(name='TargetAzoneId', description='The destination zone to which you want to modify

This parameter is required.', example='cn-hangzhou-A'),
}

model ChangeInstanceAzoneResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model ChangeInstanceAzoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeInstanceAzoneResponseBody(name='body'),
}

/**
 * @param request ChangeInstanceAzoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeInstanceAzoneResponse
 */
async function changeInstanceAzoneWithOptions(request: ChangeInstanceAzoneRequest, runtime: $RuntimeOptions): ChangeInstanceAzoneResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.changeVSwitch)) {
    query['ChangeVSwitch'] = request.changeVSwitch;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.drdsRegionId)) {
    query['DrdsRegionId'] = request.drdsRegionId;
  }
  if (!$isNull(request.newVSwitch)) {
    query['NewVSwitch'] = request.newVSwitch;
  }
  if (!$isNull(request.originAzoneId)) {
    query['OriginAzoneId'] = request.originAzoneId;
  }
  if (!$isNull(request.targetAzoneId)) {
    query['TargetAzoneId'] = request.targetAzoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeInstanceAzone',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ChangeInstanceAzoneRequest
 * @return ChangeInstanceAzoneResponse
 */
async function changeInstanceAzone(request: ChangeInstanceAzoneRequest): ChangeInstanceAzoneResponse {
  var runtime = new $RuntimeOptions{};
  return changeInstanceAzoneWithOptions(request, runtime);
}

model CheckDrdsDbNameRequest {
  dbName?: string(name='DbName', description='DRDS database name

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='DRDS instance ID

This parameter is required.', example='drds********'),
}

model CheckDrdsDbNameResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='CF38538C-68BD-4278-B58F-EDE96F******'),
  result?: boolean(name='Result', description='Indicates whether the DRDS database name is valid. Valid values: true: The database name is valid. false: the database name is invalid.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the call is successful.', example='true'),
}

model CheckDrdsDbNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDrdsDbNameResponseBody(name='body'),
}

/**
 * @param request CheckDrdsDbNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckDrdsDbNameResponse
 */
async function checkDrdsDbNameWithOptions(request: CheckDrdsDbNameRequest, runtime: $RuntimeOptions): CheckDrdsDbNameResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckDrdsDbName',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CheckDrdsDbNameRequest
 * @return CheckDrdsDbNameResponse
 */
async function checkDrdsDbName(request: CheckDrdsDbNameRequest): CheckDrdsDbNameResponse {
  var runtime = new $RuntimeOptions{};
  return checkDrdsDbNameWithOptions(request, runtime);
}

model CheckExpandStatusRequest {
  dbName?: string(name='DbName', description='The name of the PolarDB-X database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***********'),
}

model CheckExpandStatusResponseBody = {
  data?: {
    isActive?: boolean(name='IsActive', description='Indicates whether scale-out operations can be performed on the database.', example='true'),
    msg?: string(name='Msg', description='The additional information.', example='success'),
  }(name='Data', description='The result of the verification.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7CDBA7D5-8D62-4D24-9C65-510D62******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model CheckExpandStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckExpandStatusResponseBody(name='body'),
}

/**
 * @summary Verifies whether scale-out operations such as smooth scale-out can be performed on a PolarDB-X database.
 *
 * @param request CheckExpandStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckExpandStatusResponse
 */
async function checkExpandStatusWithOptions(request: CheckExpandStatusRequest, runtime: $RuntimeOptions): CheckExpandStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckExpandStatus',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Verifies whether scale-out operations such as smooth scale-out can be performed on a PolarDB-X database.
 *
 * @param request CheckExpandStatusRequest
 * @return CheckExpandStatusResponse
 */
async function checkExpandStatus(request: CheckExpandStatusRequest): CheckExpandStatusResponse {
  var runtime = new $RuntimeOptions{};
  return checkExpandStatusWithOptions(request, runtime);
}

model CheckSqlAuditEnableStatusRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
}

model CheckSqlAuditEnableStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FF13E47D-4E38-4A5A-BA68-32A554******'),
  status?: string(name='Status', description='The status of the SQL audit feature. Valid values:

*   enabled: The SQL audit feature is enabled.
*   disabled: The SQL audit feature is disabled.', example='enabled'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model CheckSqlAuditEnableStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckSqlAuditEnableStatusResponseBody(name='body'),
}

/**
 * @summary Checks whether the SQL audit feature is enabled for the logical database of a PolarDB-X 1.0 instance.
 *
 * @param request CheckSqlAuditEnableStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckSqlAuditEnableStatusResponse
 */
async function checkSqlAuditEnableStatusWithOptions(request: CheckSqlAuditEnableStatusRequest, runtime: $RuntimeOptions): CheckSqlAuditEnableStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckSqlAuditEnableStatus',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether the SQL audit feature is enabled for the logical database of a PolarDB-X 1.0 instance.
 *
 * @param request CheckSqlAuditEnableStatusRequest
 * @return CheckSqlAuditEnableStatusResponse
 */
async function checkSqlAuditEnableStatus(request: CheckSqlAuditEnableStatusRequest): CheckSqlAuditEnableStatusResponse {
  var runtime = new $RuntimeOptions{};
  return checkSqlAuditEnableStatusWithOptions(request, runtime);
}

model CreateDrdsDBRequest {
  accountName?: string(name='AccountName', description='The name of the account that has permissions to access all databases on the ApsaraDB RDS for MySQL instance.

This parameter is required only when the Type parameter is set to VERTICAL.', example='drds_sample_account'),
  dbInstType?: string(name='DbInstType', description='The type of the storage instances that are used by the PolarDB-X 1.0 database. Set the value to RDS.', example='RDS'),
  dbInstanceIsCreating?: boolean(name='DbInstanceIsCreating', description='Specifies whether the required ApsaraDB RDS for MySQL instance is being created.', example='false'),
  dbName?: string(name='DbName', description='The name of the PolarDB-X 1.0 database you want to create.', example='testdb'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance on which you want to create the database.

This parameter is required.', example='drdshbgal154****'),
  encode?: string(name='Encode', description='The encoding method that is used by the database.', example='utf8'),
  instDbName?: [ 
    {
      dbInstanceId?: string(name='DbInstanceId', description='The ID of the ApsaraDB RDS for MySQL instance on which the databases need to be vertically partitioned. This parameter is required only when the Type parameter is set to VERTICAL.', example='drds_sample_rds_id'),
      shardDbName?: [ string ](name='ShardDbName', example='["drds_sample_db1", "drds_sample_db2"]'),
    }
  ](name='InstDbName'),
  password?: string(name='Password', description='The password that is used to log on to the database.', example='drds_sample_password'),
  rdsInstance?: [ string ](name='RdsInstance', example='["drds_sample_rds_id1", "drds_sample_rds_id2"]'),
  rdsSuperAccount?: [ 
    {
      accountName?: string(name='AccountName', description='The account name of the super administrator that is used to connect to the ApsaraDB RDS for MySQL instance.', example='drds_sample_rds_super_account'),
      dbInstanceId?: string(name='DbInstanceId', description='The ID of ApsaraDB RDS instance.', example='drds_sample_rds_id'),
      password?: string(name='Password', description='The password of the super administrator account that is used to connect to the ApsaraDB RDS instance.', example='drds_sample_rds_super_password'),
    }
  ](name='RdsSuperAccount'),
  type?: string(name='Type', description='The partitioning mode of the database. Valid values:

*   **HORIZONTAL**: The database is horizontally partitioned (sharded).
*   **VERTICAL**: The database is vertically partitioned.', example='HORIZONTAL'),
}

model CreateDrdsDBResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FF13E47D-4E38-4A5A-BA68-32A554AD45T6'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model CreateDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDrdsDBResponseBody(name='body'),
}

/**
 * @param request CreateDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDrdsDBResponse
 */
async function createDrdsDBWithOptions(request: CreateDrdsDBRequest, runtime: $RuntimeOptions): CreateDrdsDBResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.dbInstanceIsCreating)) {
    query['DbInstanceIsCreating'] = request.dbInstanceIsCreating;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.encode)) {
    query['Encode'] = request.encode;
  }
  if (!$isNull(request.instDbName)) {
    query['InstDbName'] = request.instDbName;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.rdsInstance)) {
    query['RdsInstance'] = request.rdsInstance;
  }
  if (!$isNull(request.rdsSuperAccount)) {
    query['RdsSuperAccount'] = request.rdsSuperAccount;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDrdsDB',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateDrdsDBRequest
 * @return CreateDrdsDBResponse
 */
async function createDrdsDB(request: CreateDrdsDBRequest): CreateDrdsDBResponse {
  var runtime = new $RuntimeOptions{};
  return createDrdsDBWithOptions(request, runtime);
}

model CreateDrdsInstanceRequest {
  clientToken?: string(name='ClientToken', description='Specifies the client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

This parameter is required.', example='c1dd299c-10c6-11ea-bbbb-************'),
  description?: string(name='Description', description='Specifies the description of the instance. The description must meet the following requirements:

*   The description cannot contain the prefix http:// or https://.
*   The description must start with a letter or a Chinese character, and can contain uppercase and lowercase letters, Chinese characters, digits, underscores (_), and hyphens (-).
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='test'),
  duration?: int32(name='Duration', description='Specifies the purchase duration of the subscription instance.

*   If the PricingCycle parameter is set to year, the value range of the Duration parameter is 1 to 3.
*   If the PricingCycle parameter is set to month, the value range of the Duration parameter is 1 to 9.

>  This parameter only takes effect when the PayType parameter is set to drdsPre.', example='1'),
  instanceSeries?: string(name='InstanceSeries', description='Specifies the instance type of the instance. Valid values:

*   **drds.sn2.4c16g**: The instance is of the Starter Edition.
*   **drds.sn2.8c32g**: The instance is of the Standard Edition
*   **drds.sn2.16c64g**: The instance is of the Enterprise Edition.

This parameter is required.', example='drds.sn2.4c16g'),
  isAutoRenew?: boolean(name='IsAutoRenew', description='Specifies whether to enable automatic renewal. Valid values:

*   **true**: If the PricingCycle parameter is set to month, the subscription is automatically renewed for one month. If the PricingCycle parameter is set to year, the subscription is automatically renewed for one year.
*   **false**: The auto-renewal feature is disabled for the instance.

>  This parameter only takes effect when the PayType parameter is set to drdsPre.', example='true'),
  masterInstId?: string(name='MasterInstId', description='Specifies the ID of the primary instance. This parameter is only required when you create a read-only instance.', example='drds***********'),
  mySQLVersion?: int32(name='MySQLVersion', description='Specifies the MySQL version that is supported by the instance. Valid values:

*   **5**: The instance is fully compatible with MySQL 5.x. This value is the default value.
*   **8**: The instance is fully compatible with MySQL 8.0.

>  This parameter only takes effect when you create a primary instance. By default, the MySQL version of the read-only instance is the same as that of the primary instance.', example='5'),
  payType?: string(name='PayType', description='Specifies the billing method of the instance. Valid values:

*   **drdsPre**: The instance uses the subscription billing method.
*   **drdsPost**: The instance uses the pay-as-you-go billing method.
*   **drdsRo**: By default, the pay-as-you-go billing method is used when you create read-only instances.

This parameter is required.', example='drdsPost'),
  pricingCycle?: string(name='PricingCycle', description='Specifies the unit of the subscription duration of the subscription instance. Valid values:

*   **year**: The unit of the subscription duration is year.
*   **month**: The unit of the subscription duration is month.

>  This parameter is required if you set the PayType parameter to drdsPre.', example='month'),
  quantity?: int32(name='Quantity', description='Specifies the number of instances to be created. You can set the value only to 1. The value specifies that you can create one instance each time.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='Specifies the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='Specifies the ID of the resource group.', example='rg-************'),
  specification?: string(name='Specification', description='Specifies the specification code of the instance. The value consists of the instance type and the specified instance specification. For example, you can set the value to drds.sn2.4c16g.8c32g.

This parameter is required.', example='drds.sn2.4c16g.8C32g'),
  type?: string(name='Type', description='Specifies the type of the instance. Set the value to PRIVATE. The value PRIVATE specifies that the instance is a dedicated instance.

>  You can also set the value to 1 to specify that the instance is a dedicated instance.

This parameter is required.', example='PRIVATE'),
  vpcId?: string(name='VpcId', description='Specifies the ID of the VPC.', example='vpc-**********'),
  vswitchId?: string(name='VswitchId', description='Specifies the ID of the vSwitch.', example='vsw-**********'),
  zoneId?: string(name='ZoneId', description='Specifies the zone ID of the instance.

This parameter is required.', example='cn-hangzhou-e'),
  isHa?: boolean(name='isHa', description='Specifies whether the instance is a high-availability instance.', example='true'),
}

model CreateDrdsInstanceResponseBody = {
  data?: {
    drdsInstanceIdList?: {
      drdsInstanceIdList?: [ string ](name='drdsInstanceIdList')
    }(name='DrdsInstanceIdList', description='Indicates the ID of the instance.'),
    orderId?: long(name='OrderId', description='Indicates the ID of the order.', example='111111111111111'),
  }(name='Data', description='Indicates the details of the result.'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='D99D4644-A70D-49A3-B8B4-767ACC50SE2R'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model CreateDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDrdsInstanceResponseBody(name='body'),
}

/**
 * @param request CreateDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDrdsInstanceResponse
 */
async function createDrdsInstanceWithOptions(request: CreateDrdsInstanceRequest, runtime: $RuntimeOptions): CreateDrdsInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!$isNull(request.instanceSeries)) {
    query['InstanceSeries'] = request.instanceSeries;
  }
  if (!$isNull(request.isAutoRenew)) {
    query['IsAutoRenew'] = request.isAutoRenew;
  }
  if (!$isNull(request.masterInstId)) {
    query['MasterInstId'] = request.masterInstId;
  }
  if (!$isNull(request.mySQLVersion)) {
    query['MySQLVersion'] = request.mySQLVersion;
  }
  if (!$isNull(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!$isNull(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!$isNull(request.quantity)) {
    query['Quantity'] = request.quantity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.specification)) {
    query['Specification'] = request.specification;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.vswitchId)) {
    query['VswitchId'] = request.vswitchId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  if (!$isNull(request.isHa)) {
    query['isHa'] = request.isHa;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDrdsInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateDrdsInstanceRequest
 * @return CreateDrdsInstanceResponse
 */
async function createDrdsInstance(request: CreateDrdsInstanceRequest): CreateDrdsInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createDrdsInstanceWithOptions(request, runtime);
}

model CreateInstanceAccountRequest {
  accountName?: string(name='AccountName', description='The username of the account you want to create.

This parameter is required.', example='drds_sample_account'),
  dbPrivilege?: [ 
    {
      dbName?: string(name='DbName', description='The name of the database that you want to manage by using the account to create.', example='test123'),
      privilege?: string(name='Privilege', description='The permissions that you want to grant to the account to manage the database.', example='DDL'),
    }
  ](name='DbPrivilege', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance for which you want to create the account.

This parameter is required.', example='drdsjiii1b49****'),
  password?: string(name='Password', description='The password of the account you want to create.

This parameter is required.', example='drds_sample_password'),
}

model CreateInstanceAccountResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FF13E47D-4E38-4A5A-BA68-4E610EVF56DC'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model CreateInstanceAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceAccountResponseBody(name='body'),
}

/**
 * @param request CreateInstanceAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceAccountResponse
 */
async function createInstanceAccountWithOptions(request: CreateInstanceAccountRequest, runtime: $RuntimeOptions): CreateInstanceAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.dbPrivilege)) {
    query['DbPrivilege'] = request.dbPrivilege;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateInstanceAccount',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateInstanceAccountRequest
 * @return CreateInstanceAccountResponse
 */
async function createInstanceAccount(request: CreateInstanceAccountRequest): CreateInstanceAccountResponse {
  var runtime = new $RuntimeOptions{};
  return createInstanceAccountWithOptions(request, runtime);
}

model CreateInstanceInternetAddressRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds****************'),
  regionId?: string(name='RegionId', description='The ID of the region to which the DRDS instance belongs.', example='cn-hangzhou'),
}

model CreateInstanceInternetAddressResponseBody = {
  code?: int32(name='Code', description='The error code returned when the activity fails.

>  This parameter appears only when an error occurs during the API call.', example='404'),
  data?: boolean(name='Data', description='Indicates whether the public IP address was created.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1DF6052F-15E2-4E69-9628-D6BCC3******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model CreateInstanceInternetAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceInternetAddressResponseBody(name='body'),
}

/**
 * @param request CreateInstanceInternetAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceInternetAddressResponse
 */
async function createInstanceInternetAddressWithOptions(request: CreateInstanceInternetAddressRequest, runtime: $RuntimeOptions): CreateInstanceInternetAddressResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateInstanceInternetAddress',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateInstanceInternetAddressRequest
 * @return CreateInstanceInternetAddressResponse
 */
async function createInstanceInternetAddress(request: CreateInstanceInternetAddressRequest): CreateInstanceInternetAddressResponse {
  var runtime = new $RuntimeOptions{};
  return createInstanceInternetAddressWithOptions(request, runtime);
}

model CreateOrderForRdsRequest {
  params?: string(name='Params', description='The JSON string that contains the order details. For more information, see [CreateDBInstance](https://help.aliyun.com/document_detail/26228.html).

This parameter is required.', example='{"key":"value"}'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model CreateOrderForRdsResponseBody = {
  data?: string(name='Data', description='The ID of the purchased RDS instance.', example='[rm-***********]'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9819BC51-D33D-4EB1-B80F-A89A20******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model CreateOrderForRdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOrderForRdsResponseBody(name='body'),
}

/**
 * @summary Creates an order to purchase an ApsaraDB RDS for MySQL instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and pricing of PolarDB-X 1.0. For more information, visit the [pricing page](https://www.aliyun.com/price/product#/rds/detail).
 *
 * @param request CreateOrderForRdsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOrderForRdsResponse
 */
async function createOrderForRdsWithOptions(request: CreateOrderForRdsRequest, runtime: $RuntimeOptions): CreateOrderForRdsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.params)) {
    query['Params'] = request.params;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateOrderForRds',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an order to purchase an ApsaraDB RDS for MySQL instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and pricing of PolarDB-X 1.0. For more information, visit the [pricing page](https://www.aliyun.com/price/product#/rds/detail).
 *
 * @param request CreateOrderForRdsRequest
 * @return CreateOrderForRdsResponse
 */
async function createOrderForRds(request: CreateOrderForRdsRequest): CreateOrderForRdsResponse {
  var runtime = new $RuntimeOptions{};
  return createOrderForRdsWithOptions(request, runtime);
}

model CreateShardTaskRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region where the resource group resides.', example='cn-hangzhou'),
  sourceTableName?: string(name='SourceTableName', description='The name of the source table.

This parameter is required.', example='test_tb1'),
  targetTableName?: string(name='TargetTableName', description='The name of the destination table.

This parameter is required.', example='test_tb2'),
  taskType?: string(name='TaskType', description='The type of the task. Valid values:`  SHARD_TO_SINGLE `,`  SINGLE_TO_SHARD `,`  SHARD_TO_SHARD `.

This parameter is required.', example='SINGLE_TO_SHARD'),
}

model CreateShardTaskResponseBody = {
  data?: boolean(name='Data', description='Task creation result', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F8997D95-94AD-416A-AE70-E24D08******'),
  success?: boolean(name='Success', description='The result of the operation.', example='true'),
}

model CreateShardTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateShardTaskResponseBody(name='body'),
}

/**
 * @param request CreateShardTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateShardTaskResponse
 */
async function createShardTaskWithOptions(request: CreateShardTaskRequest, runtime: $RuntimeOptions): CreateShardTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sourceTableName)) {
    query['SourceTableName'] = request.sourceTableName;
  }
  if (!$isNull(request.targetTableName)) {
    query['TargetTableName'] = request.targetTableName;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateShardTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateShardTaskRequest
 * @return CreateShardTaskResponse
 */
async function createShardTask(request: CreateShardTaskRequest): CreateShardTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createShardTaskWithOptions(request, runtime);
}

model DescribeBackMenuRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds***********'),
}

model DescribeBackMenuResponseBody = {
  list?: {
    list?: [ 
    {
      menuName?: string(name='MenuName', description='The backup method. Valid values:

*   **Logic **: logical backup
*   **phy**: physical backup', example='phy'),
      support?: boolean(name='Support', description='Indicates whether backup recovery is supported.', example='true'),
    }
  ](name='list')
  }(name='List', description='The backup information list.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='60C21BE4-EDFE-454C-95ED-3A5C74******'),
  success?: boolean(name='Success', description='The result of request.', example='true'),
}

model DescribeBackMenuResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackMenuResponseBody(name='body'),
}

/**
 * @param request DescribeBackMenuRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackMenuResponse
 */
async function describeBackMenuWithOptions(request: DescribeBackMenuRequest, runtime: $RuntimeOptions): DescribeBackMenuResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackMenu',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackMenuRequest
 * @return DescribeBackMenuResponse
 */
async function describeBackMenu(request: DescribeBackMenuRequest): DescribeBackMenuResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackMenuWithOptions(request, runtime);
}

model DescribeBackupDbsRequest {
  backupId?: string(name='BackupId', description='Query by backup set ID', example='201908367'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds************'),
  preferredRestoreTime?: string(name='PreferredRestoreTime', description='Query by restoration time.', example='1568632541236'),
}

model DescribeBackupDbsResponseBody = {
  dbNames?: {
    dbName?: [ string ](name='dbName')
  }(name='DbNames', description='The details about a database.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='842DFA7F-B09B-42A2-B115-E684AE******'),
  success?: boolean(name='Success', description='The result of request.', example='true'),
}

model DescribeBackupDbsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupDbsResponseBody(name='body'),
}

/**
 * @param request DescribeBackupDbsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupDbsResponse
 */
async function describeBackupDbsWithOptions(request: DescribeBackupDbsRequest, runtime: $RuntimeOptions): DescribeBackupDbsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.preferredRestoreTime)) {
    query['PreferredRestoreTime'] = request.preferredRestoreTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupDbs',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackupDbsRequest
 * @return DescribeBackupDbsResponse
 */
async function describeBackupDbs(request: DescribeBackupDbsRequest): DescribeBackupDbsResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupDbsWithOptions(request, runtime);
}

model DescribeBackupLocalRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
}

model DescribeBackupLocalResponseBody = {
  backupPolicyDO?: {
    backupAppName?: string(name='BackupAppName', description='No value is returned.', example='null'),
    backupDbName?: string(name='BackupDbName', description='No value is returned.', example='null'),
    backupLevel?: string(name='BackupLevel', description='No value is returned.', example='null'),
    backupLog?: string(name='BackupLog', description='No value is returned.', example='null'),
    backupMode?: string(name='BackupMode', description='No value is returned.', example='null'),
    backupPolicyMode?: string(name='BackupPolicyMode', description='No value is returned.', example='null'),
    backupRetentionPeriod?: long(name='BackupRetentionPeriod', description='No value is returned.', example='0'),
    backupType?: string(name='BackupType', description='No value is returned.', example='null'),
    dataBackupRetentionPeriod?: long(name='DataBackupRetentionPeriod', description='No value is returned.', example='0'),
    gmtCreate?: long(name='GmtCreate', description='No value is returned.', example='0'),
    gmtModified?: long(name='GmtModified', description='No value is returned.', example='0'),
    highSpaceUsageProtection?: long(name='HighSpaceUsageProtection', description='Indicates whether the feature is enabled to forcibly delete binary log files if the used storage space of the instance exceeds 90% of the total storage space or the remaining storage space is less than 5 GB. Valid values:

*   1: The feature is enabled.
*   0: The feature is disabled.', example='1'),
    localLogRetentionHours?: long(name='LocalLogRetentionHours', description='The number of hours for which log backup files are retained on the instance. Valid values: 0 to 168. Default value: **18**. The value **0** indicates that log backup files are not retained.', example='18'),
    localLogRetentionSpace?: long(name='LocalLogRetentionSpace', description='The maximum storage usage that is allowed for local log files. Valid values: 0 to 50. Default value: 30.', example='30'),
    logBackupRetentionPeriod?: long(name='LogBackupRetentionPeriod', description='No value is returned.', example='0'),
    nextBackupActuallyTime?: string(name='NextBackupActuallyTime', description='No value is returned.', example='null'),
    preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='No value is returned.', example='null'),
    preferredBackupTime?: string(name='PreferredBackupTime', description='No value is returned.', example='null'),
  }(name='BackupPolicyDO', description='The information about the backup policy.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FDC9CFD5-306D-4A23-9D8C-057274C6****'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeBackupLocalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupLocalResponseBody(name='body'),
}

/**
 * @summary Queries the backup settings of local logs.
 *
 * @param request DescribeBackupLocalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupLocalResponse
 */
async function describeBackupLocalWithOptions(request: DescribeBackupLocalRequest, runtime: $RuntimeOptions): DescribeBackupLocalResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupLocal',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup settings of local logs.
 *
 * @param request DescribeBackupLocalRequest
 * @return DescribeBackupLocalResponse
 */
async function describeBackupLocal(request: DescribeBackupLocalRequest): DescribeBackupLocalResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupLocalWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drdshbga71nn****'),
}

model DescribeBackupPolicyResponseBody = {
  backupPolicyDO?: {
    backupAppName?: string(name='BackupAppName', description='No value is returned.', example='null'),
    backupDbName?: string(name='BackupDbName', description='No value is returned.', example='null'),
    backupLevel?: string(name='BackupLevel', description='The backup level. Valid values:

*   **db**: database backup
*   **instance**: instance backup', example='instance'),
    backupLog?: string(name='BackupLog', description='Indicates whether the log backup feature is enabled. Valid values:

*   **1**: The log backup feature is enabled.
*   **0**: The log backup feature is disabled.', example='1'),
    backupMode?: string(name='BackupMode', description='The backup mode. Valid values:

*   **logic**: logical backup
*   **phy**: fast backup', example='phy'),
    backupPolicyMode?: string(name='BackupPolicyMode', description='The type of the backup policy. Valid values:

*   **DataBackupPolicy**: a data backup policy
*   **LogBackupPolicy**: a log backup policy', example='DataBackupPolicy'),
    backupRetentionPeriod?: long(name='BackupRetentionPeriod', description='The retention period of backup files. Unit: days.', example='0'),
    backupType?: string(name='BackupType', description='No value is returned.', example='null'),
    dataBackupRetentionPeriod?: long(name='DataBackupRetentionPeriod', description='The retention period of data backup files. Unit: days.', example='0'),
    gmtCreate?: long(name='GmtCreate', description='No value is returned.', example='0'),
    gmtModified?: long(name='GmtModified', description='No value is returned.', example='0'),
    highSpaceUsageProtection?: long(name='HighSpaceUsageProtection', description='No value is returned.', example='0'),
    localLogRetentionHours?: long(name='LocalLogRetentionHours', description='No value is returned.', example='0'),
    localLogRetentionSpace?: long(name='LocalLogRetentionSpace', description='No value is returned.', example='0'),
    logBackupRetentionPeriod?: long(name='LogBackupRetentionPeriod', description='The retention period of log backup files. Unit: days.', example='0'),
    nextBackupActuallyTime?: string(name='NextBackupActuallyTime', description='No value is returned.', example='null'),
    preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The backup cycle. You can specify multiple backup cycles. Separate multiple backup cycles with commas (,). Valid values:

*   **0**: every Monday
*   **1**: every Tuesday
*   **2**: every Wednesday
*   **3**: every Thursday
*   **4**: every Friday
*   **5**: every Saturday
*   **6**: every Sunday', example='1,4'),
    preferredBackupTime?: string(name='PreferredBackupTime', description='The time range in which a backup is performed. The time is displayed in UTC.', example='22:00:00-23:00:00'),
  }(name='BackupPolicyDO', description='The information about the backup policy.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8FAF3989-79CD-4A67-8FFD-97899B64****'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the information about a backup policy.
 *
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: $RuntimeOptions): DescribeBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupPolicy',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about a backup policy.
 *
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupSetsRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds***********'),
  endTime?: string(name='EndTime', description='The end of the query time which is in timestamp format (measured in millisecond) .

>  The end time must be later than the start time.

This parameter is required.', example='1591326000000'),
  startTime?: string(name='StartTime', description='The beginning of the query time which is in timestamp format (measured in millisecond).

This parameter is required.', example='1591327800000'),
}

model DescribeBackupSetsResponseBody = {
  backupSets?: {
    backupSet?: [ 
    {
      backupConsitentTime?: string(name='BackupConsitentTime', description='Backup Recovery duration.', example='2020-06-05 11:31:38'),
      backupDbs?: {
        backupDb?: [ string ](name='backupDb')
      }(name='BackupDbs', description='The list of backup databases.'),
      backupEndTime?: long(name='BackupEndTime', description='The end of the backup time which is in timestamp format (measured in millisecond).

>  0 indicates not finished.', example='1591327899000'),
      backupLevel?: string(name='BackupLevel', description='The level of the backup. Valid values:

*   db: The database level.
*   instance: the instance level.', example='instance'),
      backupMode?: string(name='BackupMode', description='The backup method. Valid values:

*   logic: the logical backup.
*   phy: fast backup', example='logic'),
      backupStartTime?: long(name='BackupStartTime', description='The beginning of the backup time which is in timestamp format (measured in millisecond).', example='1591327754000'),
      backupTotalSize?: string(name='BackupTotalSize', description='The size of the backup set. Unit: MB.', example='93.24'),
      backupType?: string(name='BackupType', description='The type of the backup. Valid values:

*   manual: indicates a manual backup.
*   auto: indicates an automatic backup.', example='manual'),
      enableRecovery?: boolean(name='EnableRecovery', description='Indicates whether the backup set can be restored. Valid values:', example='false'),
      id?: string(name='Id', description='The ID of the data backup file you want to use.', example='ba30d5c4-a6dc-11ea-bd40-************'),
      status?: long(name='Status', description='The status of the backup instance. Valid values:

*   \\\\-1: Failed
*   0: Not started
*   1: The storage instance is running.
*   2: Success', example='2'),
    }
  ](name='backupSet')
  }(name='BackupSets', description='The list of backup sets.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7103AEE3-9025-442F-B82B-BABD0A******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeBackupSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupSetsResponseBody(name='body'),
}

/**
 * @param request DescribeBackupSetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupSetsResponse
 */
async function describeBackupSetsWithOptions(request: DescribeBackupSetsRequest, runtime: $RuntimeOptions): DescribeBackupSetsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupSets',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackupSetsRequest
 * @return DescribeBackupSetsResponse
 */
async function describeBackupSets(request: DescribeBackupSetsRequest): DescribeBackupSetsResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupSetsWithOptions(request, runtime);
}

model DescribeBackupTimesRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga71nn****'),
}

model DescribeBackupTimesResponseBody = {
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='4780A19F-5ECB-4C56-AD20-966A3FF9DE5R'),
  restoreTime?: {
    endTime?: string(name='EndTime', description='Indicates the end time. The time is in the UNIX timestamp format. The time is in UTC. Unit: ms.', example='1568636922671'),
    startTime?: string(name='StartTime', description='Indicates the start time. The time is in the UNIX timestamp format. The time must be in UTC. Unit: ms.', example='1568632853000'),
  }(name='RestoreTime', description='Indicates the information about the time range within which the data of the instance can be restored to a point in time.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeBackupTimesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupTimesResponseBody(name='body'),
}

/**
 * @param request DescribeBackupTimesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupTimesResponse
 */
async function describeBackupTimesWithOptions(request: DescribeBackupTimesRequest, runtime: $RuntimeOptions): DescribeBackupTimesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupTimes',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackupTimesRequest
 * @return DescribeBackupTimesResponse
 */
async function describeBackupTimes(request: DescribeBackupTimesRequest): DescribeBackupTimesResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupTimesWithOptions(request, runtime);
}

model DescribeBroadcastTablesRequest {
  currentPage?: int32(name='CurrentPage', description='The number of the page to return.', example='1'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test_db'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='10'),
  query?: string(name='Query', description='The content of the query.', example='tb1'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model DescribeBroadcastTablesResponseBody = {
  isShard?: boolean(name='IsShard', description='Indicates whether the database is sharded.', example='true'),
  list?: [ 
    {
      broadcast?: boolean(name='Broadcast', description='Indicates whether a table is a broadcast table.', example='true'),
      broadcastType?: string(name='BroadcastType', description='Indicates the type of the broadcast table. Valid values:

*   **1**: multi-write mode
*   **2**: synchronous mode', example='1'),
      dbInstType?: int32(name='DbInstType', description='Indicates the storage type of the database. Valid values:

*   **0**: RDS
*   **4**: PolarDB', example='0'),
      isShard?: boolean(name='IsShard', description='Indicates whether the broadcast table was sharded.', example='false'),
      status?: int32(name='Status', description='Indicates the activation state of the broadcast table. Valid values:

*   **1**: The broadcast table is activated.
*   **2**: The broadcast table is being activated.
*   **3**: An exception occurs when the broadcast table is being activated.', example='1'),
      table?: string(name='Table', description='Indicates the name of the table.', example='nation'),
    }
  ](name='List', description='Indicates information about broadcast tables.'),
  pageNumber?: int32(name='PageNumber', description='Indicates the page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='Indicates the number of entries returned per page.', example='40'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='86E420ED-43F2-4788-A58C-921849******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: int32(name='Total', description='Indicates the total number of entries returned.', example='2'),
}

model DescribeBroadcastTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBroadcastTablesResponseBody(name='body'),
}

/**
 * @param request DescribeBroadcastTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBroadcastTablesResponse
 */
async function describeBroadcastTablesWithOptions(request: DescribeBroadcastTablesRequest, runtime: $RuntimeOptions): DescribeBroadcastTablesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    query['Query'] = request.query;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBroadcastTables',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBroadcastTablesRequest
 * @return DescribeBroadcastTablesResponse
 */
async function describeBroadcastTables(request: DescribeBroadcastTablesRequest): DescribeBroadcastTablesResponse {
  var runtime = new $RuntimeOptions{};
  return describeBroadcastTablesWithOptions(request, runtime);
}

model DescribeDbInstanceDbsRequest {
  accountName?: string(name='AccountName', description='The name of the privileged account of the PolarDB-X 1.0 instance. You do not need to specify this parameter if you have no privileged account.', example='test'),
  dbInstType?: string(name='DbInstType', description='The engine type of the storage-layer databases. Valid values: **POLARDB** and **RDS**.', example='POLARDB'),
  dbInstanceId?: string(name='DbInstanceId', description='The ID of the instance in which the storage-layer databases are deployed.

This parameter is required.', example='pc-****************'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  password?: string(name='Password', description='The password of the privileged account. You do not need to specify this parameter if you have no privileged account.', example='pwd_111111'),
}

model DescribeDbInstanceDbsResponseBody = {
  databases?: {
    database?: [ 
    {
      dbName?: string(name='DbName', description='Indicates the name of a storage-layer database.', example='db_test'),
      description?: string(name='Description', description='Indicates the description of the storage-layer database.', example='test'),
      status?: int32(name='Status', description='Indicates the state of the storage-layer database. Valid values:

*   **0**: The database is being created.
*   **1**: The database is available.
*   **3**: The database is being deleted.', example='1'),
    }
  ](name='Database')
  }(name='Databases', description='Indicates the information about the storage-layer databases.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E9F3D991-08DE-4B74-BE0E-06B809******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: string(name='Total', description='Indicates the total number of storage-layer databases.', example='1'),
}

model DescribeDbInstanceDbsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDbInstanceDbsResponseBody(name='body'),
}

/**
 * @param request DescribeDbInstanceDbsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDbInstanceDbsResponse
 */
async function describeDbInstanceDbsWithOptions(request: DescribeDbInstanceDbsRequest, runtime: $RuntimeOptions): DescribeDbInstanceDbsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDbInstanceDbs',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDbInstanceDbsRequest
 * @return DescribeDbInstanceDbsResponse
 */
async function describeDbInstanceDbs(request: DescribeDbInstanceDbsRequest): DescribeDbInstanceDbsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDbInstanceDbsWithOptions(request, runtime);
}

model DescribeDbInstancesRequest {
  dbInstType?: string(name='DbInstType', description='Storage layer type. Valid values: **POLARDB** or **RDS**.', example='POLARDB'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds************'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  search?: string(name='Search', description='The ID of the storage or cluster.', example='pc-***************'),
}

model DescribeDbInstancesResponseBody = {
  items?: {
    DBInstance?: [ 
    {
      allowAllCategory?: boolean(name='AllowAllCategory'),
      DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the storage instance.', example='test'),
      DBInstanceId?: string(name='DBInstanceId', description='The ID of the storage instance.', example='rm-****************'),
      DBInstanceStatus?: int32(name='DBInstanceStatus', description='Storage layer instance status. Valid values:

*   **0**: creating
*   **1**: In use
*   **3**: Deleting
*   **5**: restarting
*   **6**: upgrading /Downgrading
*   **7**: Recovering
*   **8**: switching the Internet and intranet', example='0'),
      DBInstanceType?: string(name='DBInstanceType', description='The storage layer instance type.', example='Primary'),
      engine?: string(name='Engine', description='The engine of the storage instance.'),
      engineVersion?: string(name='EngineVersion', description='The version of the engine for the storage instance.', example='5.7'),
      instanceNetworkType?: string(name='InstanceNetworkType', description='The network type of the storage layer. Valid values:

*   **VPC**: VPC
*   **CLASSIC **: Classic Network', example='VPC'),
      readOnlyDBInstanceId?: {
        readOnlyDBInstanceId?: [ string ](name='ReadOnlyDBInstanceId')
      }(name='ReadOnlyDBInstanceId', description='The details about a read-only storage instance.'),
      regionId?: string(name='RegionId', description='The ID of the region where the storage instance resides.', example='cn-hangzhou'),
      zoneId?: string(name='ZoneId', description='The ID of the zone where the storage instance resides.', example='cn-hangzhou-a'),
    }
  ](name='DBInstance')
  }(name='Items', description='The details of the instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='293275B3-8FC0-4619-A26E-6F062FASD56R'),
}

model DescribeDbInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDbInstancesResponseBody(name='body'),
}

/**
 * @summary Queries DescribeDbInstances of the storage layer, such as RDS or PolarDB.
 *
 * @param request DescribeDbInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDbInstancesResponse
 */
async function describeDbInstancesWithOptions(request: DescribeDbInstancesRequest, runtime: $RuntimeOptions): DescribeDbInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDbInstances',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries DescribeDbInstances of the storage layer, such as RDS or PolarDB.
 *
 * @param request DescribeDbInstancesRequest
 * @return DescribeDbInstancesResponse
 */
async function describeDbInstances(request: DescribeDbInstancesRequest): DescribeDbInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeDbInstancesWithOptions(request, runtime);
}

model DescribeDrdsDBRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='db_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
}

model DescribeDrdsDBResponseBody = {
  data?: {
    createTime?: string(name='CreateTime', description='Indicates the time when the database was created. The value is in the UNIX timestamp format. Unit: ms.', example='1602050276000'),
    dbInstType?: string(name='DbInstType', description='Indicates the storage type of the database.', example='RDS'),
    dbName?: string(name='DbName', description='Indicates the name of the database.', example='db_test'),
    instRole?: string(name='InstRole', description='Indicates the type of the instance in which the database is deployed. Valid values:

*   **MASTER**: The instance is a primary instance.
*   **SLAVE**: The instance is a read-only instance.', example='MASTER'),
    mode?: string(name='Mode', description='Indicates the database sharding method.

*   **HORIZONTAL**: The database is horizontally sharded.
*   **VERTICAL**: The database is vertically sharded.', example='HORIZONTAL'),
    schema?: string(name='Schema', description='Indicates the schema name of the database.', example='db_test*******************'),
    status?: string(name='Status', description='Indicates the state of the database. Valid values:

*   **TO_BE_INIT**: The database is being created.
*   **NORMAL**: The database is running.', example='NORMAL'),
  }(name='Data', description='Indicates the details about the database.'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='58FB0EC7-CF71-4E48-92FB-CF070D******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBResponse
 */
async function describeDrdsDBWithOptions(request: DescribeDrdsDBRequest, runtime: $RuntimeOptions): DescribeDrdsDBResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDB',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsDBRequest
 * @return DescribeDrdsDBResponse
 */
async function describeDrdsDB(request: DescribeDrdsDBRequest): DescribeDrdsDBResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDBWithOptions(request, runtime);
}

model DescribeDrdsDBClusterRequest {
  dbInstanceId?: string(name='DbInstanceId', description='The ID of the PolarDB cluster.

This parameter is required.', example='pc-*****************'),
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds*********'),
}

model DescribeDrdsDBClusterResponseBody = {
  dbInstance?: {
    DBInstanceId?: string(name='DBInstanceId', description='The ID of the PolarDB cluster.', example='pc-*****************'),
    DBInstanceStatus?: string(name='DBInstanceStatus', description='The status of the PolarDB instance.', example='1'),
    DBNodes?: {
      DBNode?: [ 
      {
        DBNodeId?: string(name='DBNodeId', description='The ID of the node in the apsaradb for PolarDB cluster.', example='pi-***************'),
        DBNodeRole?: string(name='DBNodeRole', description='The role of a node in the apsaradb for PolarDB cluster. Valid values:

*   **Reader**
*   **Writer**', example='Reader'),
        DBNodeStatus?: string(name='DBNodeStatus', description='The status of the nodes in the PolarDB cluster.', example='Running'),
        zoneId?: string(name='ZoneId', description='The ID of the zone where the node of the PolarDB cluster resides.', example='cn-hangzhou-i'),
      }
    ](name='DBNode')
    }(name='DBNodes', description='The information about the nodes in the PolarDB Cluster.'),
    dbInstType?: string(name='DbInstType', description='The type of storage used by the DRDS database.', example='POLARDB'),
    endpoints?: {
      endpoint?: [ 
      {
        endpointId?: string(name='EndpointId', description='The ID of the PolarDB connection address.', example='pe-*****************'),
        nodeIds?: string(name='NodeIds', description='The ID list of the nodes in the PolarDB connection string. Separate multiple nodes with commas (,).', example='pi-*****************,pi-*****************'),
        readWeight?: int32(name='ReadWeight', description='The read ratio of this connection address managed by the DRDS database.', example='85'),
      }
    ](name='Endpoint')
    }(name='Endpoints', description='The endpoint of the PolarDB read /write splitting endpoint'),
    engine?: string(name='Engine', description='The type of the DRDS database storage engine.', example='POLARDB'),
    engineVersion?: string(name='EngineVersion', description='The version of the DRDS database storage engine.', example='8.0'),
    expireTime?: string(name='ExpireTime', description='The time when the PolarDB cluster expires.', example='2019-09-27 11:22:33'),
    networkType?: string(name='NetworkType', description='The network type of the PolarDB cluster.', example='VPC'),
    payType?: string(name='PayType', description='The billing method of the PolarDB cluster.', example='Postpaid'),
    port?: int32(name='Port', description='The PolarDB access port.', example='3306'),
    rdsInstType?: string(name='RdsInstType', description='The type of RDS instance. PolarDB cluster does not support this parameter.', example='ignore'),
    readMode?: string(name='ReadMode', description='This parameter specifies the Read mode when the database storage type is PolarDB.

Valid values:

*   **DEFAULT**: the default mode (that is, all read traffic is sent to the PolarDB read /write node).
*   **CUSTOM**: Custom mode (you can customize the ratio of traffic sent to read /write nodes and read-only nodes).
*   **BALANCE**: read balancing mode (the read traffic is automatically distributed by the read load module of the PolarDB cluster, which can also be understood as the read traffic being evenly distributed to each node).', example='CUSTOM'),
    remainDays?: string(name='RemainDays', description='The number of days remaining on the PolarDB for MySQL instance.', example='0'),
  }(name='DbInstance', description='The details of each PolarDB cluster.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='60A77FD6-0DE4-4A34-B6FB-9C2673******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeDrdsDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBClusterResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the information of the PolarDB cluster in the DRDS logical database.
 *
 * @param request DescribeDrdsDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBClusterResponse
 */
async function describeDrdsDBClusterWithOptions(request: DescribeDrdsDBClusterRequest, runtime: $RuntimeOptions): DescribeDrdsDBClusterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDBCluster',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the information of the PolarDB cluster in the DRDS logical database.
 *
 * @param request DescribeDrdsDBClusterRequest
 * @return DescribeDrdsDBClusterResponse
 */
async function describeDrdsDBCluster(request: DescribeDrdsDBClusterRequest): DescribeDrdsDBClusterResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDBClusterWithOptions(request, runtime);
}

model DescribeDrdsDBIpWhiteListRequest {
  dbName?: string(name='DbName', description='The database name.

This parameter is required.', example='test_db'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The instance ID.

This parameter is required.', example='drds********'),
  groupName?: string(name='GroupName', description='The name of the whitelist group.', example='group1'),
  regionId?: string(name='RegionId'),
}

model DescribeDrdsDBIpWhiteListResponseBody = {
  ipWhiteList?: {
    ip?: [ string ](name='Ip')
  }(name='IpWhiteList', description='The IP address whitelist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='017453B9-0001-4745-87BF-DD612D850ED0'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsDBIpWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBIpWhiteListResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBIpWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBIpWhiteListResponse
 */
async function describeDrdsDBIpWhiteListWithOptions(request: DescribeDrdsDBIpWhiteListRequest, runtime: $RuntimeOptions): DescribeDrdsDBIpWhiteListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDBIpWhiteList',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsDBIpWhiteListRequest
 * @return DescribeDrdsDBIpWhiteListResponse
 */
async function describeDrdsDBIpWhiteList(request: DescribeDrdsDBIpWhiteListRequest): DescribeDrdsDBIpWhiteListResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDBIpWhiteListWithOptions(request, runtime);
}

model DescribeDrdsDBsRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga1138****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value of this parameter must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of databases to return on each page. Valid values: **30**, **50**, and **100**.

Default value: **30**.', example='30'),
  regionId?: string(name='RegionId', description='The ID of the region in which the PolarDB-X 1.0 instance is created.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDrdsDBsResponseBody = {
  data?: {
    db?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the database is created. The value of this parameter is a UNIX timestamp. Unit: ms.', example='1563773824000'),
      dbInstType?: string(name='DbInstType', description='The type of the database. Valid values: **RDS** and **POLARDB**.', example='RDS'),
      dbName?: string(name='DbName', description='The name of the database.', example='drds_test'),
      mode?: string(name='Mode', description='The partitioning mode of the database. Valid values:

*   **HORIZONTAL**: The database is horizontally partitioned.
*   **VERTICAL**: The database is vertically partitioned.', example='HORIZONTAL'),
      schema?: string(name='Schema', description='The schema ID that is assigned to the partitioned database.', example='drds_test_1563773871118kxqd'),
      status?: string(name='Status', description='The state of the database.', example='NORMAL'),
    }
  ](name='Db')
  }(name='Data', description='The list of returned databases.'),
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The number of databases returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='006B7D19-8CDB-4AA6-AAE7-23C107GS3W2T'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: string(name='Total', description='The number of returned databases.', example='1'),
}

model DescribeDrdsDBsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBsResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBsResponse
 */
async function describeDrdsDBsWithOptions(request: DescribeDrdsDBsRequest, runtime: $RuntimeOptions): DescribeDrdsDBsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDBs',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsDBsRequest
 * @return DescribeDrdsDBsResponse
 */
async function describeDrdsDBs(request: DescribeDrdsDBsRequest): DescribeDrdsDBsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDBsWithOptions(request, runtime);
}

model DescribeDrdsDbInstanceRequest {
  dbInstanceId?: string(name='DbInstanceId', description='The ID of the custom ApsaraDB RDS for MySQL instance that you want to query.

This parameter is required.', example='rm-bp1t1mk5a5bdj****'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The name of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga1138****'),
}

model DescribeDrdsDbInstanceResponseBody = {
  dbInstance?: {
    connectUrl?: string(name='ConnectUrl', description='The URL used to connect to the custom ApsaraDB RDS for MySQL instance.', example='rm-***************.mysql.rds.aliyuncs.com'),
    DBInstanceId?: string(name='DBInstanceId', description='The ID of the ApsaraDB RDS for MySQL instance.', example='rm-***************'),
    DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the instance.', example='1'),
    dbInstType?: string(name='DbInstType', description='The role of the instance. Valid values:

*   **Primary**: The instance is a primary instance.
*   **ReadOnly**: The instance is a read-only instance.', example='Primary'),
    dmInstanceId?: string(name='DmInstanceId', description='The ID of the resource.', example='dm-*************'),
    engine?: string(name='Engine', description='The engine of the database that is run on the instance. Valid value: **MySQL**.', example='MySQL'),
    engineVersion?: string(name='EngineVersion', description='The engine version of the database that is run on the instance. Valid values: **5.7**.', example='5.7'),
    expireTime?: string(name='ExpireTime', description='The time when the custom ApsaraDB RDS for MySQL instance expires. The value of this parameter is a UNIX timestamp. Unit: seconds.

>  This parameter is returned only when the custom ApsaraDB RDS for MySQL instance is a subscription instance.', example='12341434315'),
    networkType?: string(name='NetworkType', description='The type of the network. Valid values: **VPC**.', example='VPC'),
    payType?: string(name='PayType', description='The billing method of the custom ApsaraDB RDS for MySQL instance. Valid values:

*   **Prepaid**: subscription
*   **Postaid**: pay-as-you-go', example='Postpaid'),
    port?: int32(name='Port', description='The port used to connect to the custom ApsaraDB RDS for MySQL instance.', example='3306'),
    rdsInstType?: string(name='RdsInstType', description='The type of the instance.', example='RDS'),
    readOnlyInstances?: {
      readOnlyInstance?: [ 
      {
        connectUrl?: string(name='ConnectUrl', description='The URL used to connect to the read-only instance.', example='rm-bp1ub71ct9skc3yxx.mysql.rds.aliyuncs.com'),
        DBInstanceId?: string(name='DBInstanceId', description='The ID of the read-only instance.', example='rm-bp1ub71ct9skc****'),
        DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the read-only instance.', example='1'),
        dbInstType?: string(name='DbInstType', description='The role of the read-only instance.', example='RDS'),
        dmInstanceId?: string(name='DmInstanceId', description='The ID of the resource.', example='dm-*************'),
        engine?: string(name='Engine', description='The engine of the database that is run on the read-only instance.', example='MySQL'),
        engineVersion?: string(name='EngineVersion', description='The engine version of the database that is run on the read-only instance.', example='5.7'),
        expireTime?: string(name='ExpireTime', description='The timestamp that indicates when the read-only instance expires.', example='1823487328173'),
        networkType?: string(name='NetworkType', description='The network type of the read-only instance.', example='VPC'),
        payType?: string(name='PayType', description='The billing method of the read-only instance.', example='Postpaid'),
        port?: int32(name='Port', description='The port used to connect to the read-only instance.', example='3306'),
        rdsInstType?: string(name='RdsInstType', description='The type of the ApsaraDB RDS for MySQL instance.', example='RDS'),
        readWeight?: int32(name='ReadWeight', description='The read ratio of the read-only instance.', example='30'),
        remainDays?: string(name='RemainDays', description='The number of remaining days before the read-only instance expires.', example='0'),
        versionAction?: int32(name='VersionAction', description='This parameter is unavailable for read-only instances.', example='0'),
      }
    ](name='ReadOnlyInstance')
    }(name='ReadOnlyInstances', description='The list of read-only ApsaraDB RDS for MySQL instances.'),
    readWeight?: int32(name='ReadWeight', description='The read ratio of the instance.', example='70'),
    remainDays?: string(name='RemainDays', description='The number of remaining days before the instance expires.', example='0'),
  }(name='DbInstance', description='The detailed information about the returned custom ApsaraDB RDS for MySQL instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4FE09970-CA69-4144-88CA-67FB4BTY56G3'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsDbInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDbInstanceResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDbInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDbInstanceResponse
 */
async function describeDrdsDbInstanceWithOptions(request: DescribeDrdsDbInstanceRequest, runtime: $RuntimeOptions): DescribeDrdsDbInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDbInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsDbInstanceRequest
 * @return DescribeDrdsDbInstanceResponse
 */
async function describeDrdsDbInstance(request: DescribeDrdsDbInstanceRequest): DescribeDrdsDbInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDbInstanceWithOptions(request, runtime);
}

model DescribeDrdsDbInstancesRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='dbname'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga1138****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='30'),
}

model DescribeDrdsDbInstancesResponseBody = {
  dbInstances?: {
    dbInstance?: [ 
    {
      connectUrl?: string(name='ConnectUrl', description='Indicates the endpoint that is used to connect to an ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='rm-bp1t1mk5a5b******.mysql.rds.aliyuncs.com'),
      DBInstanceId?: string(name='DBInstanceId', description='Indicates the ID of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='rm-bp1t1mk5a5bdj****'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='Indicates the state of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database. Valid values:

*   **0**: The ApsaraDB RDS for MySQL instance is being created.
*   **1**: The ApsaraDB RDS for MySQL instance is running.
*   **3**: The ApsaraDB RDS for MySQL instance is being deleted.
*   **5**: The ApsaraDB RDS for MySQL instance is being restarted.
*   **6**: The ApsaraDB RDS for MySQL instance is being upgraded or downgraded.
*   **7**: The ApsaraDB RDS for MySQL instance is being backed up.
*   **8**: The network type of the ApsaraDB RDS for MySQL instance is being changed.
*   **9**: The ApsaraDB RDS for MySQL instance is being migrated.
*   **11**: The data of the ApsaraDB RDS for MySQL instance is being migrated.
*   **12**: A disaster-recovery instance is being generated.
*   **13**: Data is being imported to the ApsaraDB RDS for MySQL instance.
*   **14**: Data is being imported to the ApsaraDB RDS for MySQL instance from an another ApsaraDB RDS for MySQL instance.
*   **15**: A failover is being performed.
*   **16**: A temporary instance is being created.
*   **17**: A network is being created for the ApsaraDB RDS for MySQL instance.
*   **18**: The ApsaraDB RDS for MySQL instance is being cloned.
*   **19**: The link is being changed.
*   **20**: The read-only instances of the ApsaraDB RDS for MySQL instance are being migrated.', example='1'),
      dbInstType?: string(name='DbInstType', description='Indicates the type of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database. The value is set to RDS.', example='RDS'),
      dmInstanceId?: string(name='DmInstanceId', description='Indicates the ID of a resource.', example='dm-hbgau1zp****'),
      engine?: string(name='Engine', description='Indicates the engine of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='MySQL'),
      engineVersion?: string(name='EngineVersion', description='Indicates the engine version of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='5.7'),
      expireTime?: string(name='ExpireTime', description='Indicates the point in time when the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database expires.', example='1237486127634'),
      networkType?: string(name='NetworkType', description='Indicates the network type of the ApsaraDB RDS for MySQL instance.', example='VPC'),
      payType?: string(name='PayType', description='Indicates the billing method of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database. Valid values:

*   **drdsPre**: The instance uses the subscription billing method.
*   **drdsPost**: The instance uses the pay-as-you-go billing method.', example='PostPaid'),
      port?: int32(name='Port', description='Indicates the port that is used to connect to the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='3306'),
      rdsInstType?: string(name='RdsInstType', description='Indicates whether the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database is a primary instance or a read-only instance.

*   **Primary**: The instance is a primary instance.
*   **Readonly**: The instance is a read-only instance.', example='Primary'),
      readOnlyInstances?: {
        readOnlyInstance?: [ 
        {
          connectUrl?: string(name='ConnectUrl', description='Indicates the endpoint that is used to connect to the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='rm-bp1t1mk5a5b******.mysql.rds.aliyuncs.com'),
          DBInstanceStatus?: string(name='DBInstanceStatus', description='Indicates the state of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database. Valid values:

*   **0**: The ApsaraDB RDS for MySQL instance is being created.
*   **1**: The ApsaraDB RDS for MySQL instance is running.
*   **3**: The ApsaraDB RDS for MySQL instance is being deleted.
*   **5**: The ApsaraDB RDS for MySQL instance is being restarted.
*   **6**: The ApsaraDB RDS for MySQL instance is being upgraded or downgraded.
*   **7**: The ApsaraDB RDS for MySQL instance is being backed up.
*   **8**: The network type of the ApsaraDB RDS for MySQL instance is being changed.
*   **9**: The ApsaraDB RDS for MySQL instance is being migrated.
*   **11**: The data of the ApsaraDB RDS for MySQL instance is being migrated.
*   **12**: A disaster-recovery instance is being generated.
*   **13**: Data is being imported to the ApsaraDB RDS for MySQL instance.
*   **14**: Data is being imported to the ApsaraDB RDS for MySQL instance from an another ApsaraDB RDS for MySQL instance.
*   **15**: A failover is being performed.
*   **16**: A temporary instance is being created.
*   **17**: A network is being created for the ApsaraDB RDS for MySQL instance.
*   **18**: The ApsaraDB RDS for MySQL instance is being cloned.
*   **19**: The link is being changed.
*   **20**: The read-only instances of the ApsaraDB RDS for MySQL instance are being migrated.', example='1'),
          dbInstType?: string(name='DbInstType', description='Indicates the type of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database. The value is set to RDS.', example='RDS'),
          dmInstanceId?: string(name='DmInstanceId', description='Indicates the ID of a resource.', example='dm-hbgau1zp****'),
          engine?: string(name='Engine', description='Indicates the engine of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='MySQL'),
          engineVersion?: string(name='EngineVersion', description='Indicates the engine version of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.', example='5.7'),
          expireTime?: string(name='ExpireTime', description='Indicates the timestamp when the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database expires.', example='123421352351234'),
          instanceName?: string(name='InstanceName', description='Indicates the name of a read-only instance.', example='**'),
          networkType?: string(name='NetworkType', description='Indicates the network type of the read-only instance.', example='VPC'),
          payType?: string(name='PayType', description='Indicates the billing method of the read-only instance.

*   **drdsPre**: The instance uses the subscription billing method.
*   **drdsPost**: The instance uses the pay-as-you-go billing method.', example='Postpaid'),
          port?: int32(name='Port', description='Indicates the port that is used to connect to the read-only instance.', example='3306'),
          rdsInstType?: string(name='RdsInstType', description='Indicates the type of the read-only instance.', example='RDS'),
          readWeight?: int32(name='ReadWeight', description='Indicates the read weight of the read-only instance.', example='70'),
          remainDays?: int32(name='RemainDays', description='Indicates the number of remaining days before the read-only instance expires.', example='0'),
        }
      ](name='ReadOnlyInstance')
      }(name='ReadOnlyInstances', description='Indicates information about the read-only instances of the ApsaraDB RDS for MySQL instance that is used to store the data of the specified database.'),
      readWeight?: int32(name='ReadWeight', description='Indicates the read weight of the read-only instance.', example='30'),
      remainDays?: int32(name='RemainDays', description='Indicates the number of remaining days before a subscription instance expires.', example='0'),
    }
  ](name='DbInstance')
  }(name='DbInstances', description='Indicates information about the ApsaraDB RDS for MySQL instances that are used to store the data of the specified database.'),
  pageNumber?: string(name='PageNumber', description='Indicates the page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='Indicates the number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: string(name='Total', description='Indicates the number of primary ApsaraDB RDS for MySQL instances.', example='1'),
}

model DescribeDrdsDbInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDbInstancesResponseBody(name='body'),
}

/**
 * @summary Queries ApsaraDB RDS for MySQL instances that are used to store the data of a database.
 *
 * @param request DescribeDrdsDbInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDbInstancesResponse
 */
async function describeDrdsDbInstancesWithOptions(request: DescribeDrdsDbInstancesRequest, runtime: $RuntimeOptions): DescribeDrdsDbInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDbInstances',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries ApsaraDB RDS for MySQL instances that are used to store the data of a database.
 *
 * @param request DescribeDrdsDbInstancesRequest
 * @return DescribeDrdsDbInstancesResponse
 */
async function describeDrdsDbInstances(request: DescribeDrdsDbInstancesRequest): DescribeDrdsDbInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDbInstancesWithOptions(request, runtime);
}

model DescribeDrdsDbRdsNameListRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdsxxxxxxxxxxx'),
}

model DescribeDrdsDbRdsNameListResponseBody = {
  instanceNameList?: {
    instanceName?: [ string ](name='InstanceName')
  }(name='InstanceNameList', description='Indicates the instances that are used to store the data of a database.'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='7E6FA2BF-05F2-44DD-95C0-D1B5B8xxxxxx'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsDbRdsNameListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDbRdsNameListResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDbRdsNameListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDbRdsNameListResponse
 */
async function describeDrdsDbRdsNameListWithOptions(request: DescribeDrdsDbRdsNameListRequest, runtime: $RuntimeOptions): DescribeDrdsDbRdsNameListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsDbRdsNameList',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsDbRdsNameListRequest
 * @return DescribeDrdsDbRdsNameListResponse
 */
async function describeDrdsDbRdsNameList(request: DescribeDrdsDbRdsNameListRequest): DescribeDrdsDbRdsNameListResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsDbRdsNameListWithOptions(request, runtime);
}

model DescribeDrdsInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance that you want to query.

This parameter is required.', example='drdshbga1138****'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instance is created.', example='cn-hangzhou'),
}

model DescribeDrdsInstanceResponseBody = {
  data?: {
    commodityCode?: string(name='CommodityCode', description='The commodity code of the instance.', example='drdsPost'),
    createTime?: long(name='CreateTime', description='The timestamp that indicates when the instance is created.', example='1568620311000'),
    description?: string(name='Description', description='The description of the instance.', example='drds_test'),
    drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.', example='drdssen1243as'),
    expireDate?: long(name='ExpireDate', description='The timestamp that indicates when the instance expires.', example='4724323200000'),
    instRole?: string(name='InstRole', description='The role of the instance. Valid values:

*   **MASTER**: The instance is a primary instance.
*   **SLAVE**: The instance is a read-only instance to analyze complex queries
*   **SLAVE_FLOW**: The instance is a read-only instance for high-concurrency scenarios', example='MASTER'),
    instanceSeries?: string(name='InstanceSeries', description='The instance series of the instance.', example='drds.sn2.4c16g'),
    instanceSpec?: string(name='InstanceSpec', description='The specification of the instance.', example='drds.sn2.4c16g.8C32G'),
    label?: string(name='Label', description='The tag of the instance. Valid values:

*   **NORMAL**: The instance is a standard instance.
*   **HA**: The instance is a high-availability (HA) instance.
*   **VPC**: The instance is a VPC-based instance.', example='NORMAL'),
    machineType?: string(name='MachineType', description='The machine type of the instance. The value of this parameter is **ecs**.', example='ecs'),
    masterInstanceId?: string(name='MasterInstanceId', description='The ID of the primary instance.

>  This parameter is returned only when the instance is a primary instance.', example='drdssen1243as'),
    mysqlVersion?: int32(name='MysqlVersion', description='The MySQL version that is supported by the instance.', example='5'),
    networkType?: string(name='NetworkType', description='The network type of the instance. Valid values: CLASSIC and VPC.', example='CLASSIC'),
    orderInstanceId?: string(name='OrderInstanceId', description='The ID of the purchased instance.', example='drdssen12****'),
    productVersion?: string(name='ProductVersion', description='The version of .', example='5.3.*'),
    readOnlyDBInstanceIds?: {
      readOnlyDBInstanceId?: [ string ](name='ReadOnlyDBInstanceId')
    }(name='ReadOnlyDBInstanceIds', description='The details about each read-only instance that is associated with the instance.'),
    regionId?: string(name='RegionId', description='The ID of the region in which the instance is created.', example='cn-hangzhou'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs. The value of this parameter can be null.', example='NULL'),
    status?: string(name='Status', description='The state of the instance.', example='RUN'),
    storageType?: string(name='StorageType', description='The type of the instance used for storage.', example='RDS'),
    type?: string(name='Type', description='The type of the instance. Valid values: PRIVATE and PUBLIC. The value of PRIVATE indicates that the instance is a dedicated instance. The value of PUBLIC indicates that the instance is a shared instance.', example='PRIVATE'),
    version?: long(name='Version', description='The version of the instance. The value of this parameter is 0.', example='0'),
    versionAction?: string(name='VersionAction', description='Indicates whether the version of the instance can be upgraded.', example='Upgradeable'),
    vips?: {
      vip?: [ 
      {
        dns?: string(name='Dns', description='The domain name that is mapped to the VIP.', example='drdssen1243as.drds.aliyuncs.com'),
        expireDays?: long(name='ExpireDays', description='The number of remaining days before the VIP expires.', example='0'),
        port?: string(name='Port', description='The ports that are opened on the VIP.', example='3306'),
        removeWeight?: boolean(name='RemoveWeight'),
        type?: string(name='Type', description='The type of the VIP. Valid values: intranet and internet.', example='intranet'),
        vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp**********'),
        vswitchId?: string(name='VswitchId', description='The ID of the vSwitch.', example='vsw-bp***********'),
      }
    ](name='Vip')
    }(name='Vips', description='The list of returned virtual IP addresses (VIPs).'),
    vpcCloudInstanceId?: string(name='VpcCloudInstanceId', description='The ID of the instance that is deployed in the VPC.', example='drdssen12****'),
    zoneId?: string(name='ZoneId', description='The ID of the zone in which the instance is located.', example='cn-hangzhou-e'),
  }(name='Data', description='The details of the instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B4F76641-BA45-4320-BE7C-9C62CFDAC9B2'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceResponseBody(name='body'),
}

/**
 * @summary Queries the details of a PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceResponse
 */
async function describeDrdsInstanceWithOptions(request: DescribeDrdsInstanceRequest, runtime: $RuntimeOptions): DescribeDrdsInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsInstanceRequest
 * @return DescribeDrdsInstanceResponse
 */
async function describeDrdsInstance(request: DescribeDrdsInstanceRequest): DescribeDrdsInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstanceWithOptions(request, runtime);
}

model DescribeDrdsInstanceDbMonitorRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the Distributed Relational Database Service (DRDS) instance.

This parameter is required.', example='drds*************'),
  endTime?: long(name='EndTime', description='The end time. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.

This parameter is required.', example='1603166400000'),
  key?: string(name='Key', description='The performance monitoring metrics. You can specify one or more metrics for a query at a time. Separate multiple metric parameters with commas (,).

>  For more information about the details of performance monitoring metrics, see [Database monitoring](https://help.aliyun.com/document_detail/186704.html).

This parameter is required.', example='qps'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The start time. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.

This parameter is required.', example='1603162800000'),
}

model DescribeDrdsInstanceDbMonitorResponseBody = {
  data?: [ 
    {
      key?: string(name='Key', description='The name of the monitoring metric.', example='qps'),
      unit?: string(name='Unit', description='The unit of the monitoring metric.', example='qps'),
      values?: [ 
        {
          date?: long(name='Date', description='The time point when the value of monitoring data was obtained. The value is in the UNIX timestamp format. Unit: ms.', example='1603162805000'),
          value?: string(name='Value', description='The data value.', example='0'),
        }
      ](name='Values', description='The details about the value of monitoring data.'),
    }
  ](name='Data', description='The list of monitoring data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsInstanceDbMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceDbMonitorResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceDbMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceDbMonitorResponse
 */
async function describeDrdsInstanceDbMonitorWithOptions(request: DescribeDrdsInstanceDbMonitorRequest, runtime: $RuntimeOptions): DescribeDrdsInstanceDbMonitorResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstanceDbMonitor',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsInstanceDbMonitorRequest
 * @return DescribeDrdsInstanceDbMonitorResponse
 */
async function describeDrdsInstanceDbMonitor(request: DescribeDrdsInstanceDbMonitorRequest): DescribeDrdsInstanceDbMonitorResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstanceDbMonitorWithOptions(request, runtime);
}

model DescribeDrdsInstanceLevelTasksRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance of which the unfinished tasks you want to query.

This parameter is required.', example='drdssen12****'),
}

model DescribeDrdsInstanceLevelTasksResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  tasks?: {
    task?: [ 
    {
      allowCancel?: boolean(name='AllowCancel', description='Indicates whether the task can be canceled.', example='false'),
      errMsg?: string(name='ErrMsg', description='The error message returned for the task.'),
      gmtCreate?: long(name='GmtCreate', description='The timestamp when the task is created.', example='1568705520000'),
      progress?: int32(name='Progress', description='The progress of the task. Valid values: 0 to 100.', example='99'),
      progressDescription?: string(name='ProgressDescription', description='The description of the task progress.'),
      showProgress?: boolean(name='ShowProgress', description='Indicates whether the progress of the task is displayed.', example='true'),
      targetId?: long(name='TargetId', description='The ID of the task.', example='12312'),
      taskName?: string(name='TaskName', description='The name of the task.', example='upgrade_instance'),
      taskPhase?: string(name='TaskPhase', description='The phase of the task.', example='1'),
      taskStatus?: int32(name='TaskStatus', description='The state of the task. Valid values:

*   0: The task is being executed.
*   1: The task is executed.
*   2: The task failed to be executed.
*   3: The task is canceled.', example='0'),
      taskType?: int32(name='TaskType', description='The type of the task.', example='11'),
    }
  ](name='Task')
  }(name='Tasks', description='The list of returned unfinished tasks.'),
}

model DescribeDrdsInstanceLevelTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceLevelTasksResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceLevelTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceLevelTasksResponse
 */
async function describeDrdsInstanceLevelTasksWithOptions(request: DescribeDrdsInstanceLevelTasksRequest, runtime: $RuntimeOptions): DescribeDrdsInstanceLevelTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstanceLevelTasks',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsInstanceLevelTasksRequest
 * @return DescribeDrdsInstanceLevelTasksResponse
 */
async function describeDrdsInstanceLevelTasks(request: DescribeDrdsInstanceLevelTasksRequest): DescribeDrdsInstanceLevelTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstanceLevelTasksWithOptions(request, runtime);
}

model DescribeDrdsInstanceMonitorRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drds*********'),
  endTime?: long(name='EndTime', description='The end time of the query. Specify the value in the UNIX timestamp format. The timestamp must be in UTC. Unit: ms.

>  If the time range that you specify is less than 1 hour, the monitoring data that is collected in a 1-hour period before the end time is returned.

This parameter is required.', example='1603209690000'),
  key?: string(name='Key', description='The performance monitoring metrics. You can specify one or more metrics. Separate multiple metric names with commas (,).

>  For more information about performance monitoring metrics, see [Monitor instances](https://help.aliyun.com/document_detail/186703.html).

This parameter is required.', example='cpu'),
  periodMultiple?: int32(name='PeriodMultiple', description='The multiple of the default time interval that you want to use to collect monitoring data. By default, the system collects monitoring data of resources at an interval of 1 minute. If you set the value of this parameter to 2, the system collects monitoring data of the instance at an interval of 2 minutes.', example='1'),
  regionId?: string(name='RegionId', description='The ID of the region where the instance is deployed.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The start time of the query. Specify the value in the UNIX timestamp format. The timestamp must be in UTC. Unit: ms.

This parameter is required.', example='1603123290000'),
}

model DescribeDrdsInstanceMonitorResponseBody = {
  data?: [ 
    {
      key?: string(name='Key', description='The name of the metric.', example='cpu'),
      nodeNum?: int32(name='NodeNum', description='The number of nodes.', example='1'),
      unit?: string(name='Unit', description='The unit of the metric value.', example='%'),
      values?: [ 
        {
          date?: long(name='Date', description='The point in time when the value of the metric was collected. The value is in the UNIX timestamp format. The timestamp is displayed in UTC. Unit: ms.', example='1603163400000'),
          value?: string(name='Value', description='The value of the metric.', example='1.40'),
        }
      ](name='Values', description='The details of the monitoring data of the metric.'),
    }
  ](name='Data', description='The result set of the query.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4'),
}

model DescribeDrdsInstanceMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceMonitorResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceMonitorResponse
 */
async function describeDrdsInstanceMonitorWithOptions(request: DescribeDrdsInstanceMonitorRequest, runtime: $RuntimeOptions): DescribeDrdsInstanceMonitorResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.periodMultiple)) {
    query['PeriodMultiple'] = request.periodMultiple;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstanceMonitor',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsInstanceMonitorRequest
 * @return DescribeDrdsInstanceMonitorResponse
 */
async function describeDrdsInstanceMonitor(request: DescribeDrdsInstanceMonitorRequest): DescribeDrdsInstanceMonitorResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstanceMonitorWithOptions(request, runtime);
}

model DescribeDrdsInstanceVersionRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance whose version you want to query.

This parameter is required.', example='drdshbga1138****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model DescribeDrdsInstanceVersionResponseBody = {
  data?: {
    instanceVersion?: string(name='InstanceVersion', description='The current version of the instance.', example='5.3.12-15682777'),
    newestVersion?: string(name='NewestVersion', description='The latest version of the instance.', example='5.4.12-16315258'),
  }(name='Data', description='The details about the instance version.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsInstanceVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceVersionResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceVersionResponse
 */
async function describeDrdsInstanceVersionWithOptions(request: DescribeDrdsInstanceVersionRequest, runtime: $RuntimeOptions): DescribeDrdsInstanceVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstanceVersion',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsInstanceVersionRequest
 * @return DescribeDrdsInstanceVersionResponse
 */
async function describeDrdsInstanceVersion(request: DescribeDrdsInstanceVersionRequest): DescribeDrdsInstanceVersionResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstanceVersionWithOptions(request, runtime);
}

model DescribeDrdsInstancesRequest {
  description?: string(name='Description', description='The description of the instances.', example='drds_test'),
  expired?: boolean(name='Expired', description='Specifies whether the instances that you want to query expire.', example='false'),
  mix?: boolean(name='Mix', description='Specifies whether hybrid queries are supported.', example='FALSE'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of instances returned on each page.', example='20'),
  productVersion?: string(name='ProductVersion', description='The version of the service.', example='V1'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instances you want to query belong. The value of this parameter can be NULL.', example='NULL'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag configured for the instances you want to query.', example='acs:newretail:domain'),
      value?: string(name='Value', description='The value of the tag configured for the instances you want to query.', example='NEW_RETAIL'),
    }
  ](name='Tag'),
  type?: string(name='Type', description='The type of the instances that you want to query. Valid values:

*   **0**: shared instances
*   **1**: dedicated instances', example='1'),
}

model DescribeDrdsInstancesResponseBody = {
  instances?: {
    instance?: [ 
    {
      commodityCode?: string(name='CommodityCode', description='The commodity code of the service.', example='drdsPost'),
      createTime?: long(name='CreateTime', description='The timestamp that indicates when the instance is created.', example='1568620311000'),
      description?: string(name='Description', description='The description of the instance.', example='drds_test'),
      drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.', example='drdssen12****'),
      expireDate?: long(name='ExpireDate', description='The timestamp that indicates when the instance expires.', example='4724323200000'),
      instRole?: string(name='InstRole', description='The role of the instance. Valid values:

*   MASTER: The instance is a primary instance.
*   SLAVE: The instance is a read-only instance to analyze complex queries.
*   SLAVE_FLOW: The instance is a read-only instance for high-concurrency scenarios.', example='MASTER'),
      instanceSeries?: string(name='InstanceSeries', description='The instance series.', example='drds.sn2.4c16g'),
      instanceSpec?: string(name='InstanceSpec', description='The specification of the instance.', example='drds.sn2.4c16g.8C32G'),
      label?: string(name='Label', description='The tag of the instance. Valid values:

*   **NORMAL**: The instance is a standard instance.
*   **HA**: The instance is a high-availability (HA) instance.
*   **VPC**: The instance is a VPC-based instance.', example='NORMAL'),
      machineType?: string(name='MachineType', description='The machine type of the instance. Valid value: ecs.', example='ecs'),
      masterInstanceId?: string(name='MasterInstanceId', description='The ID of the primary instance.', example='drdssen12****'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**
*   **VPC**', example='CLASSIC'),
      orderInstanceId?: string(name='OrderInstanceId', description='The ID of the purchased instance.', example='drdssen12****'),
      productVersion?: string(name='ProductVersion', description='The version of the service.', example='V1'),
      readOnlyDBInstanceIds?: {
        readOnlyDBInstanceId?: [ string ](name='ReadOnlyDBInstanceId')
      }(name='ReadOnlyDBInstanceIds', description='The IDs of read-only instances that are associated with the instance.'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou-e'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-aek2ljh3ye4****'),
      status?: string(name='Status', description='The status of the instance.', example='RUN'),
      type?: string(name='Type', description='The type of the instance. Valid values:

*   **PUBLIC**: The returned instance is a shared instance.
*   **PRIVATE**: The returned instance is a dedicated instance.', example='PRIVATE'),
      version?: long(name='Version', description='The version of the instance.', example='0'),
      versionAction?: string(name='VersionAction', description='Indicates whether the version of the instance can be upgraded.', example='Upgradable'),
      vips?: {
        vip?: [ 
        {
          IP?: string(name='IP', description='The virtual IP address.', example='10.23.***.***'),
          port?: string(name='Port', description='The ports that are opened on the VIP.', example='3306'),
          type?: string(name='Type', description='The type of the VIP. Valid values:

*   intranet: a private IP address
*   internet: a public IP address', example='intranet'),
          vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bpxxxxxxxxxxxy'),
          vswitchId?: string(name='VswitchId', description='The ID of the vSwitch.', example='vsw-bpxxxxxxxxxxxxx96'),
          dns?: string(name='dns', description='The domain name that is mapped to the VIP.', example='drdssen1243as.drds.aliyuncs.com'),
        }
      ](name='Vip')
      }(name='Vips', description='The list of returned virtual IP addresses (VIPs).'),
      vpcCloudInstanceId?: string(name='VpcCloudInstanceId', description='The ID of the instance that is deployed in the VPC.', example='drdssen12****'),
      vpcId?: string(name='VpcId', description='The ID of the VPC to which the instance belongs.', example='vpc-bp**********'),
      zoneId?: string(name='ZoneId', description='The ID of the zone in which the resource is located.', example='vsw-bpxxxxxxxxxxxxx96'),
      series?: string(name='series', description='The edition of the instance. Valid values:

*   **starter**: Starter Edition
*   **enterprise**: Enterprise Edition
*   **standard**: Standard Edition', example='enterprise'),
    }
  ](name='Instance')
  }(name='Instances', description='The list of returned instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of instances returned on each page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8734773E-7B21-4A22-9106-CBD245F8****'),
  total?: int32(name='Total', description='The total number of instances returned.', example='1'),
}

model DescribeDrdsInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstancesResponseBody(name='body'),
}

/**
 * @summary Queries instances that meet the specified conditions.
 *
 * @param request DescribeDrdsInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstancesResponse
 */
async function describeDrdsInstancesWithOptions(request: DescribeDrdsInstancesRequest, runtime: $RuntimeOptions): DescribeDrdsInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.expired)) {
    query['Expired'] = request.expired;
  }
  if (!$isNull(request.mix)) {
    query['Mix'] = request.mix;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.productVersion)) {
    query['ProductVersion'] = request.productVersion;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsInstances',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries instances that meet the specified conditions.
 *
 * @param request DescribeDrdsInstancesRequest
 * @return DescribeDrdsInstancesResponse
 */
async function describeDrdsInstances(request: DescribeDrdsInstancesRequest): DescribeDrdsInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsInstancesWithOptions(request, runtime);
}

model DescribeDrdsParamsRequest {
  dbName?: string(name='DbName', description='The name of the database.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='DescribeDrdsParams'),
  paramLevel?: string(name='ParamLevel', description='The type of nodes whose parameters you want to query. Valid values:

*   **INSTANCE: the instance level.**
*   **DB**: the database level.

This parameter is required.', example='INSTANCE'),
  regionId?: string(name='RegionId', description='The ID of the region where the PolarDB-X 1.0 instance is created.', example='cn-hangzhou'),
}

model DescribeDrdsParamsResponseBody = {
  list?: [ 
    {
      dbName?: string(name='DbName', description='Indicates the name of the database.', example='drds_test'),
      needRestart?: boolean(name='NeedRestart', description='Indicates whether a restart is required.', example='true'),
      paramDefaultValue?: string(name='ParamDefaultValue', description='Indicates the default value of a parameter.', example='1000'),
      paramDesc?: string(name='ParamDesc', description='Indicates the description of the parameter.'),
      paramEnglishName?: string(name='ParamEnglishName', description='Indicates the name of the parameter.', example='SLOW_SQL_TIME'),
      paramLevel?: string(name='ParamLevel', description='Indicates the parameter level.', example='INSTANCE'),
      paramName?: string(name='ParamName', description='Indicates the name of the parameter.'),
      paramRanges?: string(name='ParamRanges', description='Indicates the value range of the parameter.', example='[1000-900000]'),
      paramType?: string(name='ParamType', description='Indicates the type of the parameter.', example='CONFIG'),
      paramValue?: string(name='ParamValue', description='Indicates the value of the parameter.', example='1000'),
      paramVariableName?: string(name='ParamVariableName', description='Indicates the name of the variable.', example='slowSqlTime'),
    }
  ](name='List', description='Indicates information about parameters.'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeDrdsParamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsParamsResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsParamsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsParamsResponse
 */
async function describeDrdsParamsWithOptions(request: DescribeDrdsParamsRequest, runtime: $RuntimeOptions): DescribeDrdsParamsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.paramLevel)) {
    query['ParamLevel'] = request.paramLevel;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsParams',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsParamsRequest
 * @return DescribeDrdsParamsResponse
 */
async function describeDrdsParams(request: DescribeDrdsParamsRequest): DescribeDrdsParamsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsParamsWithOptions(request, runtime);
}

model DescribeDrdsRdsInstancesRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X instance.

> You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to query the information about instances in the specified account, such as the IDs of the instances.

This parameter is required.', example='drds*************'),
}

model DescribeDrdsRdsInstancesResponseBody = {
  dbInstances?: {
    dbInstance?: [ 
    {
      connectUrl?: string(name='ConnectUrl', description='The internal endpoint of the custom ApsaraDB RDS for MySQL instance at the storage layer.', example='rm-***************.mysql.rds.aliyuncs.com'),
      DBInstanceCPU?: string(name='DBInstanceCPU', description='The number of CPU cores of the custom ApsaraDB RDS for MySQL instance at the storage layer.', example='8'),
      DBInstanceClassType?: string(name='DBInstanceClassType', description='The instance family of the custom ApsaraDB RDS for MySQL instance at the storage layer. Valid values:

*   **x**: general-purpose instance family
*   **d**: dedicated instance family
*   **h**: dedicated host instance family', example='x'),
      DBInstanceId?: string(name='DBInstanceId', description='The ID of the custom ApsaraDB RDS for MySQL instance at the storage layer.', example='rm-*****************'),
      DBInstanceMemory?: long(name='DBInstanceMemory', description='The memory size of the custom ApsaraDB RDS for MySQL instance at the storage layer. Unit: MB.', example='8192'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='The status of the custom ApsaraDB RDS for MySQL instance at the storage layer. Valid values:

*   0: The instance is being created.
*   1: The instance is running.
*   3: The instance is being deleted.
*   5: The instance is being restarted.
*   6: The instance is being upgraded or downgraded.
*   7: The instance is being backed up.
*   8: The network type of the instance is being changed.
*   9: The instance is being migrated.
*   11: The data stored on the instance is being migrated.
*   12: A disaster recovery instance is being generated.
*   13: Data is being imported to the instance.
*   14: Data is being imported from another RDS instance to the instance.
*   15: A switchover is being performed.
*   16: A temporary instance is being created.
*   17: The network of the instance is being created.
*   18: The instance is being cloned.
*   19: The link is being changed.
*   20: The read-only RDS instances of the instance are being migrated.', example='1'),
      DBInstanceStorage?: long(name='DBInstanceStorage', description='The storage space of the custom ApsaraDB RDS for MySQL instance at the storage layer. Unit: GB.', example='20'),
      dbInstType?: string(name='DbInstType', description='The type of the instance at the storage layer. The value is RDS.', example='RDS'),
      dmInstanceId?: string(name='DmInstanceId', description='The ID of the resource.', example='dm-*************'),
      engine?: string(name='Engine', description='The engine type of the custom ApsaraDB RDS for MySQL instance at the storage layer. The value is MySQL.', example='MySQL'),
      engineVersion?: string(name='EngineVersion', description='The engine version of the custom ApsaraDB RDS for MySQL instance at the storage layer. The value is 8.0.', example='8.0'),
      lockMode?: int32(name='LockMode', description='The lock mode of the RDS instance. Valid values:

0: The instance is not locked.

1: The instance is manually locked.

2: The instance is automatically locked if the instance expires.

3: The instance is automatically locked if the instance is rolled back.

4: The instance is automatically locked if the storage space of the instance reaches the upper limit.

5: The instance is automatically locked if the storage space of the read-only instances reaches the upper limit.', example='1'),
      lockReason?: string(name='LockReason', description='The reason why the RDS instance is locked.', example='Manually Locked'),
      networkType?: string(name='NetworkType', description='The network type of the custom ApsaraDB RDS for MySQL instance at the storage layer. The value is VPC.', example='VPC'),
      payType?: string(name='PayType', description='The billing method of the custom ApsaraDB RDS for MySQL instance at the storage layer. Valid values:

*   Postpaid: pay-as-you-go
*   Prepaid: subscription', example='PostPaid'),
      port?: int32(name='Port', description='The port used to connect to the instance over an internal network.', example='3306'),
      rdsInstType?: string(name='RdsInstType', description='The type of the custom ApsaraDB RDS for MySQL instance at the storage layer. Valid values:

*   Primary: primary instance
*   Readonly: read-only instance', example='Primary'),
      readWeight?: int32(name='ReadWeight', description='The read and write weights of the custom ApsaraDB RDS for MySQL instance at the storage layer.', example='0'),
    }
  ](name='DbInstance')
  }(name='DbInstances', description='The information about the custom ApsaraDB RDS for MySQL instances at the storage layer.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='123DB16B-02F2-45F7-A571-843991******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeDrdsRdsInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsRdsInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the information about all custom ApsaraDB RDS for MySQL instances in a PolarDB-X instance.
 *
 * @param request DescribeDrdsRdsInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsRdsInstancesResponse
 */
async function describeDrdsRdsInstancesWithOptions(request: DescribeDrdsRdsInstancesRequest, runtime: $RuntimeOptions): DescribeDrdsRdsInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsRdsInstances',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about all custom ApsaraDB RDS for MySQL instances in a PolarDB-X instance.
 *
 * @param request DescribeDrdsRdsInstancesRequest
 * @return DescribeDrdsRdsInstancesResponse
 */
async function describeDrdsRdsInstances(request: DescribeDrdsRdsInstancesRequest): DescribeDrdsRdsInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsRdsInstancesWithOptions(request, runtime);
}

model DescribeDrdsShardingDbsRequest {
  dbName?: string(name='DbName', description='The name of the database whose shards you want to query.

This parameter is required.', example='drds_test'),
  dbNamePattern?: string(name='DbNamePattern', description='The matching pattern of the database name.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance whose database shards you want to query.

This parameter is required.', example='drdshbgaf3c63qbo'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of database shards returned on each page.', example='20'),
}

model DescribeDrdsShardingDbsResponseBody = {
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The number of database shards returned per page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='509BDE17-505A-4B3B-854D-30D3F092502F'),
  shardingDbs?: {
    shardingDb?: [ 
    {
      blockingTimeout?: int32(name='BlockingTimeout', description='The timeout period for a transaction to wait for the release of the data lock.', example='5000'),
      connectUrl?: string(name='ConnectUrl', description='The URL that is used to access the Apsara RDS for MySQL instance.', example='100.100.64.100:11569'),
      connectionProperties?: string(name='ConnectionProperties', description='The properties of the connection string.', example='connectTimeout=3000;autoReconnect=true;failOverReadOnly=false;socketTimeout=900000;rewriteBatchedStatements=true;characterEncoding=utf8'),
      dbInstanceId?: string(name='DbInstanceId', description='The ID of the Apsara RDS for MySQL instance that is used as the storage of the database shard.', example='rm-bp1hjzn0yv5j2****'),
      dbStatus?: string(name='DbStatus', description='The status of the database.', example='running'),
      dbType?: string(name='DbType', description='The engine of the database.', example='mysql'),
      groupName?: string(name='GroupName', description='The name of group on which the database shard is stored.', example='TEMP1_1568171495522SABE_KUP4_0000'),
      idleTimeOut?: int32(name='IdleTimeOut', description='The timeout period of an idle connection.', example='30'),
      maxPoolSize?: int32(name='MaxPoolSize', description='The maximum size of the connection pool.', example='60'),
      minPoolSize?: int32(name='MinPoolSize', description='The minimum size of the connection pool.', example='5'),
      preparedStatementCacheSize?: int32(name='PreparedStatementCacheSize', description='The size of cache for the returned results.', example='0'),
      shardingDbName?: string(name='ShardingDbName', description='The name of the database shard.', example='temp1_zhk1_0000'),
      userName?: string(name='UserName', description='The username that is used to connect to the ApsaraDB RDS for MySQL instance.', example='pg284mi8'),
    }
  ](name='ShardingDb')
  }(name='ShardingDbs', description='The list of returned database shards.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: string(name='Total', description='The number of returned database shards.', example='1'),
}

model DescribeDrdsShardingDbsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsShardingDbsResponseBody(name='body'),
}

/**
 * @summary Queries the database shards of an PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsShardingDbsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsShardingDbsResponse
 */
async function describeDrdsShardingDbsWithOptions(request: DescribeDrdsShardingDbsRequest, runtime: $RuntimeOptions): DescribeDrdsShardingDbsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.dbNamePattern)) {
    query['DbNamePattern'] = request.dbNamePattern;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsShardingDbs',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the database shards of an PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsShardingDbsRequest
 * @return DescribeDrdsShardingDbsResponse
 */
async function describeDrdsShardingDbs(request: DescribeDrdsShardingDbsRequest): DescribeDrdsShardingDbsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsShardingDbsWithOptions(request, runtime);
}

model DescribeDrdsSlowSqlsRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test_db'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***************'),
  endTime?: long(name='EndTime', description='The start time of the SQL query. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.

This parameter is required.', example='1568267711000'),
  exeTime?: long(name='ExeTime', description='The SQL execution time. Unit: ms.

This parameter is required.', example='1000'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='20'),
  regionId?: string(name='RegionId'),
  startTime?: long(name='StartTime', description='The end time of the SQL query. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.

This parameter is required.', example='1568269711000'),
}

model DescribeDrdsSlowSqlsResponseBody = {
  items?: {
    item?: [ 
    {
      host?: string(name='Host', description='Indicates the IP address of the execution machine.', example='10.0.***.***'),
      responseTime?: long(name='ResponseTime', description='Indicates the response time. Unit: ms.', example='1568267711'),
      schema?: string(name='Schema', description='Indicates the name of the database.', example='user'),
      sendTime?: long(name='SendTime', description='Indicates the time when the slow SQL query was sent. Unit: ms.', example='1568267711'),
      sql?: string(name='Sql', description='Indicates the content of the slow SQL query.', example='SELECT   count(1) from   payment_order where   order_status = \\\\"08\\\\";'),
    }
  ](name='Item')
  }(name='Items', description='Indicates the details of the slow SQL query.'),
  pageNumber?: int32(name='PageNumber', description='Indicates the page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='Indicates the number of entries returned on each page.', example='20'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='509BDE17-505A-4B3B-854D-30D3F0******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: int32(name='Total', description='Indicates the total number of entries.', example='1'),
}

model DescribeDrdsSlowSqlsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsSlowSqlsResponseBody(name='body'),
}

/**
 * @summary Queries a slow SQL query.
 *
 * @param request DescribeDrdsSlowSqlsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsSlowSqlsResponse
 */
async function describeDrdsSlowSqlsWithOptions(request: DescribeDrdsSlowSqlsRequest, runtime: $RuntimeOptions): DescribeDrdsSlowSqlsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.exeTime)) {
    query['ExeTime'] = request.exeTime;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsSlowSqls',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a slow SQL query.
 *
 * @param request DescribeDrdsSlowSqlsRequest
 * @return DescribeDrdsSlowSqlsResponse
 */
async function describeDrdsSlowSqls(request: DescribeDrdsSlowSqlsRequest): DescribeDrdsSlowSqlsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsSlowSqlsWithOptions(request, runtime);
}

model DescribeDrdsSqlAuditStatusRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
}

model DescribeDrdsSqlAuditStatusResponseBody = {
  data?: {
    data?: [ 
    {
      dbName?: string(name='DbName', description='The name of the database.', example='test'),
      detailed?: string(name='Detailed', description='Indicates whether the complete report of the SQL audit is supported. Valid values: true and false.', example='true'),
      enabled?: string(name='Enabled', description='Indicates whether the SQL audit feature is enabled for the database. Valid values: true and false.', example='true'),
      extraAliUid?: long(name='ExtraAliUid', description='The UID of the external delivery.

> This parameter is returned only if external log delivery is enabled.', example='111'),
      extraSlsLogStore?: string(name='ExtraSlsLogStore', description='The Log Service Logstore from which logs are delivered.

> This parameter is returned only if external log delivery is enabled.', example='test'),
      extraSlsProject?: string(name='ExtraSlsProject', description='The Log Service project from which logs are delivered.

> This parameter is returned only if external log delivery is enabled.', example='test'),
      extraWriteEnabled?: boolean(name='ExtraWriteEnabled', description='Indicates whether external log delivery is enabled. Valid values: true and false.', example='false'),
    }
  ](name='Data')
  }(name='Data', description='The returned data set.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DC3ABA3E-0F8A-4596-9104-F5155C******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeDrdsSqlAuditStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsSqlAuditStatusResponseBody(name='body'),
}

/**
 * @summary Queries the SQL audit details of a PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsSqlAuditStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsSqlAuditStatusResponse
 */
async function describeDrdsSqlAuditStatusWithOptions(request: DescribeDrdsSqlAuditStatusRequest, runtime: $RuntimeOptions): DescribeDrdsSqlAuditStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsSqlAuditStatus',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the SQL audit details of a PolarDB-X 1.0 instance.
 *
 * @param request DescribeDrdsSqlAuditStatusRequest
 * @return DescribeDrdsSqlAuditStatusResponse
 */
async function describeDrdsSqlAuditStatus(request: DescribeDrdsSqlAuditStatusRequest): DescribeDrdsSqlAuditStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsSqlAuditStatusWithOptions(request, runtime);
}

model DescribeDrdsTasksRequest {
  dbName?: string(name='DbName', description='The name of the database.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drdsxxxxxxxxxxxx'),
  taskType?: string(name='TaskType', description='The type of tasks.', example='test'),
}

model DescribeDrdsTasksResponseBody = {
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='CD412DF7-F21D-44CE-88FF-ED24917174A8'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  tasks?: {
    task?: [ 
    {
      content?: string(name='Content', description='Indicates the content of a task.', example='upgrade_instance'),
      id?: long(name='Id', description='Indicates the ID of the task.', example='64148'),
      state?: string(name='State', description='Indicates the state of the task.', example='FAILED'),
    }
  ](name='Task')
  }(name='Tasks', description='Indicates information about the tasks.'),
}

model DescribeDrdsTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsTasksResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsTasksResponse
 */
async function describeDrdsTasksWithOptions(request: DescribeDrdsTasksRequest, runtime: $RuntimeOptions): DescribeDrdsTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDrdsTasks',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDrdsTasksRequest
 * @return DescribeDrdsTasksResponse
 */
async function describeDrdsTasks(request: DescribeDrdsTasksRequest): DescribeDrdsTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeDrdsTasksWithOptions(request, runtime);
}

model DescribeExpandLogicTableInfoListRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_flashback'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
}

model DescribeExpandLogicTableInfoListResponseBody = {
  data?: {
    data?: [ 
    {
      shardDbKey?: string(name='ShardDbKey', description='Indicates the database sharding key.', example='id'),
      shardTbKey?: string(name='ShardTbKey', description='Indicates the table sharding key.', example='address'),
      tableName?: string(name='TableName', description='Indicates the name of the table.', example='employee_split2'),
    }
  ](name='data')
  }(name='Data', description='Indicates the result that is returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B6B7BDC-575D-4A77-A4F8-24B7EF******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeExpandLogicTableInfoListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExpandLogicTableInfoListResponseBody(name='body'),
}

/**
 * @param request DescribeExpandLogicTableInfoListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExpandLogicTableInfoListResponse
 */
async function describeExpandLogicTableInfoListWithOptions(request: DescribeExpandLogicTableInfoListRequest, runtime: $RuntimeOptions): DescribeExpandLogicTableInfoListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeExpandLogicTableInfoList',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeExpandLogicTableInfoListRequest
 * @return DescribeExpandLogicTableInfoListResponse
 */
async function describeExpandLogicTableInfoList(request: DescribeExpandLogicTableInfoListRequest): DescribeExpandLogicTableInfoListResponse {
  var runtime = new $RuntimeOptions{};
  return describeExpandLogicTableInfoListWithOptions(request, runtime);
}

model DescribeHotDbListRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drds**********'),
}

model DescribeHotDbListResponseBody = {
  data?: {
    list?: {
      instanceDb?: [ 
      {
        hotDbList?: {
          data?: [ string ](name='data')
        }(name='HotDbList'),
        instanceName?: string(name='InstanceName', description='The name of the instance.', example='instanceName'),
      }
    ](name='InstanceDb')
    }(name='List', description='The information about the databases on which hot-spot scale-out is performed.'),
    randomCode?: string(name='RandomCode', description='The random number.', example='jzhz'),
  }(name='Data', description='The result that is returned.'),
  msg?: string(name='Msg', description='The message that is returned.', example='msg'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B6B7BDC-575D-4A77-A4F8-24B7EF******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeHotDbListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHotDbListResponseBody(name='body'),
}

/**
 * @summary Queries the information about databases on which hots-pot scale-out is performed.
 *
 * @param request DescribeHotDbListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHotDbListResponse
 */
async function describeHotDbListWithOptions(request: DescribeHotDbListRequest, runtime: $RuntimeOptions): DescribeHotDbListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeHotDbList',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about databases on which hots-pot scale-out is performed.
 *
 * @param request DescribeHotDbListRequest
 * @return DescribeHotDbListResponse
 */
async function describeHotDbList(request: DescribeHotDbListRequest): DescribeHotDbListResponse {
  var runtime = new $RuntimeOptions{};
  return describeHotDbListWithOptions(request, runtime);
}

model DescribeInstDbLogInfoRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds*********'),
}

model DescribeInstDbLogInfoResponseBody = {
  logTimeRange?: {
    supportLatestTime?: long(name='SupportLatestTime', description='The start time of the query time range.', example='1568267711'),
    supportOldestTime?: long(name='SupportOldestTime', description='The end time of the task.', example='1568367711'),
  }(name='LogTimeRange', description='The time range for log query.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A5438952-70EE-4FA5-87A9-080DB0ASD45F'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeInstDbLogInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstDbLogInfoResponseBody(name='body'),
}

/**
 * @param request DescribeInstDbLogInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstDbLogInfoResponse
 */
async function describeInstDbLogInfoWithOptions(request: DescribeInstDbLogInfoRequest, runtime: $RuntimeOptions): DescribeInstDbLogInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstDbLogInfo',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstDbLogInfoRequest
 * @return DescribeInstDbLogInfoResponse
 */
async function describeInstDbLogInfo(request: DescribeInstDbLogInfoRequest): DescribeInstDbLogInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstDbLogInfoWithOptions(request, runtime);
}

model DescribeInstDbSlsInfoRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***********'),
}

model DescribeInstDbSlsInfoResponseBody = {
  auditInfo?: {
    logStore?: string(name='LogStore', description='The name of the LogStore.', example='test'),
    project?: string(name='Project', description='The name of the Log Service project.', example='test'),
  }(name='AuditInfo', description='The details of the SQL audit.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DC3ABA3E-0F8A-4596-9104-F5155C******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeInstDbSlsInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstDbSlsInfoResponseBody(name='body'),
}

/**
 * @summary Queries the names of the Log Service project and the Logstore used by the SQL audit feature.
 *
 * @param request DescribeInstDbSlsInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstDbSlsInfoResponse
 */
async function describeInstDbSlsInfoWithOptions(request: DescribeInstDbSlsInfoRequest, runtime: $RuntimeOptions): DescribeInstDbSlsInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstDbSlsInfo',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the names of the Log Service project and the Logstore used by the SQL audit feature.
 *
 * @param request DescribeInstDbSlsInfoRequest
 * @return DescribeInstDbSlsInfoResponse
 */
async function describeInstDbSlsInfo(request: DescribeInstDbSlsInfoRequest): DescribeInstDbSlsInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstDbSlsInfoWithOptions(request, runtime);
}

model DescribeInstanceAccountsRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
}

model DescribeInstanceAccountsResponseBody = {
  instanceAccounts?: {
    instanceAccount?: [ 
    {
      accountName?: string(name='AccountName', description='Indicates the username of an instance account.', example='test_rds3'),
      accountType?: int32(name='AccountType', description='Indicates the type of an instance account. Valid values:

*   **0**: The instance account is a privileged account.
*   **1**: The instance account is a standard account.', example='1'),
      dbPrivileges?: {
        dbPrivilege?: [ 
        {
          dbName?: string(name='DbName', description='Indicates the name of a database.', example='test_rds3'),
          privilege?: string(name='Privilege', description='Indicates the permissions that an account is granted on the database. Valid values:

*   **R**: The account is granted the permissions that are required to read the data of the database.
*   **W**: The account is granted the permissions that are required to write data to the database.
*   **DDL**: The account is granted the permissions that are required to perform DDL operations on the database.
*   **DML**: The account is granted the permissions that are required to perform DML operations on the database.', example='R'),
        }
      ](name='DbPrivilege')
      }(name='DbPrivileges', description='Indicates the information about the permissions of an account on a database.'),
      description?: string(name='Description', description='Indicates the description of an account. By default, if 0 is the value of the AccountType parameter, **Created by DRDS** is returned as the value of the Description parameter. If 1 is the value of the AccountType parameter, an empty string is returned as the value of the Description parameter. You can modify the description of an account on the Accounts page in the PolarDB-X console.', example='Created by DRDS'),
      host?: string(name='Host', description='Indicates an IP address that is allowed to access the database. The value **%** indicates that each IP address is allowed to access the database. \\\\</note>', example='%'),
    }
  ](name='InstanceAccount')
  }(name='InstanceAccounts', description='Indicates the information about the instance accounts.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E2E4056D-57EB-4353-8355-2E6284******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeInstanceAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceAccountsResponseBody(name='body'),
}

/**
 * @summary Queries information about an instance account.
 *
 * @param request DescribeInstanceAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceAccountsResponse
 */
async function describeInstanceAccountsWithOptions(request: DescribeInstanceAccountsRequest, runtime: $RuntimeOptions): DescribeInstanceAccountsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceAccounts',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about an instance account.
 *
 * @param request DescribeInstanceAccountsRequest
 * @return DescribeInstanceAccountsResponse
 */
async function describeInstanceAccounts(request: DescribeInstanceAccountsRequest): DescribeInstanceAccountsResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceAccountsWithOptions(request, runtime);
}

model DescribeInstanceSwitchAzoneRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drdsxxxxxxxxxxxx'),
}

model DescribeInstanceSwitchAzoneResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-23ERW'),
  result?: {
    originAzoneId?: string(name='OriginAzoneId', description='The ID of the source azoneId.', example='cn-hangzhou-a'),
    regionId?: string(name='RegionId', description='regionId.', example='cn-hangzhou'),
    switchAble?: boolean(name='SwitchAble', description='Indicates whether the job can be switched.', example='true'),
    targetAzones?: {
      targetAzone?: [ string ](name='TargetAzone')
    }(name='TargetAzones', description='Target azones.'),
  }(name='Result', description='The result of the operation.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeInstanceSwitchAzoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSwitchAzoneResponseBody(name='body'),
}

/**
 * @summary Check whether zone switching is enabled
 *
 * @param request DescribeInstanceSwitchAzoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSwitchAzoneResponse
 */
async function describeInstanceSwitchAzoneWithOptions(request: DescribeInstanceSwitchAzoneRequest, runtime: $RuntimeOptions): DescribeInstanceSwitchAzoneResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceSwitchAzone',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Check whether zone switching is enabled
 *
 * @param request DescribeInstanceSwitchAzoneRequest
 * @return DescribeInstanceSwitchAzoneResponse
 */
async function describeInstanceSwitchAzone(request: DescribeInstanceSwitchAzoneRequest): DescribeInstanceSwitchAzoneResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceSwitchAzoneWithOptions(request, runtime);
}

model DescribeInstanceSwitchNetworkRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
}

model DescribeInstanceSwitchNetworkResponseBody = {
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='03E12FE3-1638-483E-A9B6-1A9120SER56T'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  vpcInfos?: {
    vpcInfo?: [ 
    {
      regionId?: string(name='RegionId', description='Indicates the ID of the region in which the instance is deployed.', example='cn-hangzhou'),
      vpcId?: string(name='VpcId', description='Indicates the ID of the VPC.', example='vpc_id'),
      vpcName?: string(name='VpcName', description='Indicates the name of the VPC.', example='vpc_name'),
      vswitchInfos?: {
        vswitchInfo?: [ 
        {
          azoneId?: string(name='AzoneId', description='Indicates the ID of the zone in which the instance is deployed.', example='cn-hangzhou-a'),
          drdsSupported?: boolean(name='DrdsSupported', description='Indicates whether you can change the network type of the instance.', example='true'),
          vpcId?: string(name='VpcId', description='Indicates the ID of the VPC.', example='vpc_id'),
          vswitchId?: string(name='VswitchId', description='Indicates the ID of the vSwitch.', example='vswitch_id'),
          vswitchName?: string(name='VswitchName', description='Indicates the name of the vSwitch.', example='vswitch_name'),
        }
      ](name='VswitchInfo')
      }(name='VswitchInfos', description='Indicates information about the vSwitch to which the instance is connected.'),
    }
  ](name='VpcInfo')
  }(name='VpcInfos', description='Indicates the information about the virtual private cloud (VPC) in which the instance is deployed.'),
}

model DescribeInstanceSwitchNetworkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSwitchNetworkResponseBody(name='body'),
}

/**
 * @summary Queries whether you can change the network type of a PolarDB-X 1.0 instance.
 *
 * @description ****
 *
 * @param request DescribeInstanceSwitchNetworkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSwitchNetworkResponse
 */
async function describeInstanceSwitchNetworkWithOptions(request: DescribeInstanceSwitchNetworkRequest, runtime: $RuntimeOptions): DescribeInstanceSwitchNetworkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceSwitchNetwork',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether you can change the network type of a PolarDB-X 1.0 instance.
 *
 * @description ****
 *
 * @param request DescribeInstanceSwitchNetworkRequest
 * @return DescribeInstanceSwitchNetworkResponse
 */
async function describeInstanceSwitchNetwork(request: DescribeInstanceSwitchNetworkRequest): DescribeInstanceSwitchNetworkResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceSwitchNetworkWithOptions(request, runtime);
}

model DescribePreCheckResultRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga76p6****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the precheck task.

This parameter is required.', example='4561'),
}

model DescribePreCheckResultResponseBody = {
  preCheckResult?: {
    preCheckName?: string(name='PreCheckName', description='Indicates the name of the precheck task.'),
    state?: string(name='State', description='Indicates the state of the precheck task.', example='FAIL'),
    subCheckItems?: [ 
      {
        errorMsgCode?: string(name='ErrorMsgCode', description='Indicates the error code that is returned by a subtask.', example='1004'),
        errorMsgParams?: [ string ](name='ErrorMsgParams', description='Indicates an error message.'),
        preCheckItemName?: string(name='PreCheckItemName', description='Indicates the name of the subtask.'),
        state?: string(name='State', description='Indicates the state of the subtask.'),
      }
    ](name='SubCheckItems', description='Indicates the details about the subtasks of the precheck task.'),
  }(name='PreCheckResult', description='Indicates the result of the precheck task.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EED1A59A-CFEA-5CF8-BB4A-090E75B3D05E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribePreCheckResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePreCheckResultResponseBody(name='body'),
}

/**
 * @param request DescribePreCheckResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePreCheckResultResponse
 */
async function describePreCheckResultWithOptions(request: DescribePreCheckResultRequest, runtime: $RuntimeOptions): DescribePreCheckResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePreCheckResult',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribePreCheckResultRequest
 * @return DescribePreCheckResultResponse
 */
async function describePreCheckResult(request: DescribePreCheckResultRequest): DescribePreCheckResultResponse {
  var runtime = new $RuntimeOptions{};
  return describePreCheckResultWithOptions(request, runtime);
}

model DescribeRDSPerformanceRequest {
  dbInstType?: string(name='DbInstType', description='The type of the database engine.', example='mysql'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the Distributed Relational Database Service (DRDS) instance.

This parameter is required.', example='drds*********'),
  endTime?: long(name='EndTime', description='The end time of the query. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.', example='1603209690000'),
  keys?: string(name='Keys', description='The performance monitoring metrics. You can specify one or more metrics for a query at a time. Separate multiple metric parameters with commas (,).

>  For more information about the details of performance monitoring metrics, see [Storage monitoring](https://help.aliyun.com/document_detail/186705.html).

This parameter is required.', example='MySQL_MemCpuUsage'),
  rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the storage-layer ApsaraDB RDS for MySQL instance.

This parameter is required.', example='rm-************'),
  startTime?: long(name='StartTime', description='The start time of the query. Specify the time in the UNIX timestamp format. The time must be in UTC. Unit: ms.', example='1603123290000'),
}

model DescribeRDSPerformanceResponseBody = {
  data?: [ 
    {
      key?: string(name='Key', description='The name of the monitoring metric.', example='cpuusage'),
      nodeName?: string(name='NodeName', description='The name of the node.

>  This parameter is returned only when the storage type of the database is PolarDB for MySQL. If the storage type of the database is ApsaraDB RDS for MySQL, this parameter is not returned.', example='pi-*************'),
      nodeNum?: int32(name='NodeNum', description='The number of nodes.', example='1'),
      unit?: string(name='Unit', description='The unit of the monitoring metric.', example='%'),
      values?: [ 
        {
          date?: long(name='Date', description='The time point when the value of the monitoring metric was obtained. The value is in the UNIX timestamp format. The time is displayed in UTC. Unit: ms.', example='1603209660000'),
          value?: string(name='Value', description='The value of the monitoring metric.', example='0.58'),
        }
      ](name='Values', description='The details of the monitoring metric data.'),
    }
  ](name='Data', description='The result set of the query.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DB53EC68-463C-4187-8D2B-C2AD8C******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeRDSPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRDSPerformanceResponseBody(name='body'),
}

/**
 * @param request DescribeRDSPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRDSPerformanceResponse
 */
async function describeRDSPerformanceWithOptions(request: DescribeRDSPerformanceRequest, runtime: $RuntimeOptions): DescribeRDSPerformanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.keys)) {
    query['Keys'] = request.keys;
  }
  if (!$isNull(request.rdsInstanceId)) {
    query['RdsInstanceId'] = request.rdsInstanceId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRDSPerformance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeRDSPerformanceRequest
 * @return DescribeRDSPerformanceResponse
 */
async function describeRDSPerformance(request: DescribeRDSPerformanceRequest): DescribeRDSPerformanceResponse {
  var runtime = new $RuntimeOptions{};
  return describeRDSPerformanceWithOptions(request, runtime);
}

model DescribeRdsCommodityRequest {
  commodityCode?: string(name='CommodityCode', description='The commodity code of the service.

This parameter is required.', example='drdsPost'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***********'),
  orderType?: string(name='OrderType', description='The type of the order.', example='1'),
}

model DescribeRdsCommodityResponseBody = {
  data?: string(name='Data', description='Indicates the returned result.', example='test'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='DC3ABA3E-0F8A-4596-9104-F5155C34315B'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeRdsCommodityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRdsCommodityResponseBody(name='body'),
}

/**
 * @param request DescribeRdsCommodityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRdsCommodityResponse
 */
async function describeRdsCommodityWithOptions(request: DescribeRdsCommodityRequest, runtime: $RuntimeOptions): DescribeRdsCommodityResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRdsCommodity',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeRdsCommodityRequest
 * @return DescribeRdsCommodityResponse
 */
async function describeRdsCommodity(request: DescribeRdsCommodityRequest): DescribeRdsCommodityResponse {
  var runtime = new $RuntimeOptions{};
  return describeRdsCommodityWithOptions(request, runtime);
}

model DescribeRdsPerformanceSummaryRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds************'),
  rdsInstanceId?: [ string ](name='RdsInstanceId', description='This parameter is required.', example='rm-*****************'),
  regionId?: string(name='RegionId', description='The ID of the region where the streaming domain resides.', example='cn-hangzhou'),
}

model DescribeRdsPerformanceSummaryResponseBody = {
  rdsPerformanceInfos?: [ 
    {
      activeSessions?: int32(name='ActiveSessions', description='The number of active sessions of the RDS instance.', example='0'),
      cpu?: float(name='Cpu', description='The CPU utilization of an RDS instance.', example='0.26'),
      iops?: float(name='Iops', description='The IOPS of the RDS instance.', example='17.62'),
      rdsId?: string(name='RdsId', description='The ID of an RDS instance.', example='rm-**************'),
      spaceUsage?: long(name='SpaceUsage', description='The disk usage of apsaradb for RDS. Unit: MB.', example='4145144777'),
      totalSessions?: int32(name='TotalSessions', description='The total number of current RDS sessions.', example='162'),
    }
  ](name='RdsPerformanceInfos', description='A collection of objects.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B6876277-ECFD-4658-AC1E-A7FAD8******'),
  success?: boolean(name='Success', description='Indicates whether the API request is successful.', example='true'),
}

model DescribeRdsPerformanceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRdsPerformanceSummaryResponseBody(name='body'),
}

/**
 * @param request DescribeRdsPerformanceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRdsPerformanceSummaryResponse
 */
async function describeRdsPerformanceSummaryWithOptions(request: DescribeRdsPerformanceSummaryRequest, runtime: $RuntimeOptions): DescribeRdsPerformanceSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.rdsInstanceId)) {
    query['RdsInstanceId'] = request.rdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRdsPerformanceSummary',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeRdsPerformanceSummaryRequest
 * @return DescribeRdsPerformanceSummaryResponse
 */
async function describeRdsPerformanceSummary(request: DescribeRdsPerformanceSummaryRequest): DescribeRdsPerformanceSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return describeRdsPerformanceSummaryWithOptions(request, runtime);
}

model DescribeRdsSuperAccountInstancesRequest {
  dbInstType?: string(name='DbInstType', description='The type of the ApsaraDB RDS for MySQL instances. Default value: **RDS**.', example='RDS'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  rdsInstance?: [ string ](name='RdsInstance', description='This parameter is required.', example='[\\\\"rm-*****************\\\\",\\\\"rm-*****************\\\\"]'),
}

model DescribeRdsSuperAccountInstancesResponseBody = {
  dbInstances?: {
    dbInstance?: [ string ](name='DbInstance')
  }(name='DbInstances', description='The privileged accounts.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D64DE5944A1E541E0******'),
}

model DescribeRdsSuperAccountInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRdsSuperAccountInstancesResponseBody(name='body'),
}

/**
 * @param request DescribeRdsSuperAccountInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRdsSuperAccountInstancesResponse
 */
async function describeRdsSuperAccountInstancesWithOptions(request: DescribeRdsSuperAccountInstancesRequest, runtime: $RuntimeOptions): DescribeRdsSuperAccountInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.rdsInstance)) {
    query['RdsInstance'] = request.rdsInstance;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRdsSuperAccountInstances',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeRdsSuperAccountInstancesRequest
 * @return DescribeRdsSuperAccountInstancesResponse
 */
async function describeRdsSuperAccountInstances(request: DescribeRdsSuperAccountInstancesRequest): DescribeRdsSuperAccountInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeRdsSuperAccountInstancesWithOptions(request, runtime);
}

model DescribeRecycleBinStatusRequest {
  dbName?: string(name='DbName', description='The name of the database that is created in the PolarDB-X 1.0 instance.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model DescribeRecycleBinStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='ACB5258F-25AF-4D7C-8FAA-B6FE60******'),
  status?: string(name='Status', description='The status of the table recycle bin. Valid values:

*   disable: The table recycle bin is enabled.
*   enable: The table recycle bin is disabled.', example='disable'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeRecycleBinStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRecycleBinStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of the table recycle bin.
 *
 * @param request DescribeRecycleBinStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRecycleBinStatusResponse
 */
async function describeRecycleBinStatusWithOptions(request: DescribeRecycleBinStatusRequest, runtime: $RuntimeOptions): DescribeRecycleBinStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRecycleBinStatus',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of the table recycle bin.
 *
 * @param request DescribeRecycleBinStatusRequest
 * @return DescribeRecycleBinStatusResponse
 */
async function describeRecycleBinStatus(request: DescribeRecycleBinStatusRequest): DescribeRecycleBinStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeRecycleBinStatusWithOptions(request, runtime);
}

model DescribeRecycleBinTablesRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drds***********'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model DescribeRecycleBinTablesResponseBody = {
  data?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the table was created.', example='2019-09-16 14:42:06'),
      originalTableName?: string(name='OriginalTableName', description='The original name of the table.', example='BIN_T4AG3CY5WWXPKHITCHJY'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Data', description='The data object returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D64DE5944A1E541E0CB908A'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model DescribeRecycleBinTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRecycleBinTablesResponseBody(name='body'),
}

/**
 * @summary Queries the tables that can be restored in the recycle bin.
 *
 * @param request DescribeRecycleBinTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRecycleBinTablesResponse
 */
async function describeRecycleBinTablesWithOptions(request: DescribeRecycleBinTablesRequest, runtime: $RuntimeOptions): DescribeRecycleBinTablesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRecycleBinTables',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tables that can be restored in the recycle bin.
 *
 * @param request DescribeRecycleBinTablesRequest
 * @return DescribeRecycleBinTablesResponse
 */
async function describeRecycleBinTables(request: DescribeRecycleBinTablesRequest): DescribeRecycleBinTablesResponse {
  var runtime = new $RuntimeOptions{};
  return describeRecycleBinTablesWithOptions(request, runtime);
}

model DescribeRestoreOrderRequest {
  backupDbNames?: string(name='BackupDbNames', description='The name of the database involved in the backup.', example='drds_flashback'),
  backupId?: string(name='BackupId', description='The ID of the backup set.', example='1918df27-4563-11e9-8403-af4fbe******'),
  backupLevel?: string(name='BackupLevel', description='The level of the backup. Valid values:

*   **DB**: The database Level
*   **instance **: instance level', example='db'),
  backupMode?: string(name='BackupMode', description='The backup mode. Valid values: **logic** or **phy**.', example='phy'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance for which to modify the backup policy.

This parameter is required.', example='drds************'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The preferred backup time.', example='2019-09-16 15:12:53'),
}

model DescribeRestoreOrderResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AD2DE5D-B86B-40B5-9678-487D37******'),
  restoreOrderDO?: {
    drdsOrderDOList?: {
      drdsOrderDOList?: [ 
      {
        azoneId?: string(name='AzoneId', description='The ID of the zone for which to query resources.', example='cn-hangzhou-e'),
        instSpec?: string(name='InstSpec', description='The instance type of the instance.', example='4C8G * 2'),
        network?: string(name='Network', description='The network type. Valid values:

*   **Classic **: Classic Network
*   **vpc**: VPC', example='vpc'),
        regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
        VSwtichId?: string(name='VSwtichId', description='The ID of the vSwitch in the VPC.', example='vsw-*******************'),
        vpcId?: string(name='VpcId', description='The ID of the VPC network.', example='vpc-*******************'),
      }
    ](name='DrdsOrderDOList')
    }(name='DrdsOrderDOList', description='The information of the restored order.'),
    polarOrderDOList?: {
      polarOrderDOList?: [ 
      {
        azoneId?: string(name='AzoneId', description='The zone ID of the node.', example='cn-hangzhou-g'),
        dbInstanceStorage?: string(name='DbInstanceStorage', description='The capacity of disk.', example='10240'),
        engine?: string(name='Engine', description='The storage engine of PolarDB.', example='POLARDB'),
        instanceClass?: string(name='InstanceClass', description='The type of the instance.', example='polar.mysql.x4.large'),
        network?: string(name='Network', description='The network type. Valid values:

*   **Classic**: Classic Network
*   **vpc**: VPC', example='VPC'),
        num?: long(name='Num', description='The number of streams that were returned.', example='1'),
        regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
        version?: string(name='Version', description='The version of the operating system.', example='5.6'),
      }
    ](name='PolarOrderDOList')
    }(name='PolarOrderDOList', description='The ID of the restored apsaradb for PolarDB cluster.'),
    rdsOrderDOList?: {
      rdsOrderDOList?: [ 
      {
        azoneId?: string(name='AzoneId', description='The zone ID of the node.', example='cn-hangzhou-g'),
        dbInstanceStorage?: string(name='DbInstanceStorage', description='The capacity of disk.', example='10240'),
        engine?: string(name='Engine', description='The storage engine of the instance.', example='MYSQL'),
        instanceClass?: string(name='InstanceClass', description='The instance type of the instance.', example='rds.mysql.s2.large'),
        network?: string(name='Network', description='The network type. Valid values: - **Classic **: Classic Network
- **vpc**: VPC', example='VPC'),
        num?: long(name='Num', description='The number of streams that were returned.', example='1'),
        regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
        version?: string(name='Version', description='The version of the operating system.', example='5.6'),
      }
    ](name='RdsOrderDOList')
    }(name='RdsOrderDOList', description='The information of the restored RDS order.'),
  }(name='RestoreOrderDO', description='The returned data object.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DescribeRestoreOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRestoreOrderResponseBody(name='body'),
}

/**
 * @summary You can call the DescribeRestoreOrder operation to view the details of the order.
 *
 * @param request DescribeRestoreOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRestoreOrderResponse
 */
async function describeRestoreOrderWithOptions(request: DescribeRestoreOrderRequest, runtime: $RuntimeOptions): DescribeRestoreOrderResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupDbNames)) {
    query['BackupDbNames'] = request.backupDbNames;
  }
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.backupLevel)) {
    query['BackupLevel'] = request.backupLevel;
  }
  if (!$isNull(request.backupMode)) {
    query['BackupMode'] = request.backupMode;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRestoreOrder',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call the DescribeRestoreOrder operation to view the details of the order.
 *
 * @param request DescribeRestoreOrderRequest
 * @return DescribeRestoreOrderResponse
 */
async function describeRestoreOrder(request: DescribeRestoreOrderRequest): DescribeRestoreOrderResponse {
  var runtime = new $RuntimeOptions{};
  return describeRestoreOrderWithOptions(request, runtime);
}

model DescribeShardTaskInfoRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='jjjjjj_ppppp'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  sourceTableName?: string(name='SourceTableName', description='The name of the table that you want to convert or shard.

This parameter is required.', example='a1'),
  targetTableName?: string(name='TargetTableName', description='The name of the table that is generated after you convert or shard the table.

This parameter is required.', example='a2'),
}

model DescribeShardTaskInfoResponseBody = {
  data?: {
    expired?: string(name='Expired', description='Indicates the number of remaining days before the tasks to shard tables or convert tables expire.', example='0'),
    full?: {
      expired?: int32(name='Expired', description='Indicates the number of remaining days before the tasks expire.', example='0'),
      progress?: int32(name='Progress', description='Indicates the progress of the tasks.', example='100'),
      startTime?: string(name='StartTime', description='Indicates the start time when the tasks are performed.', example='2019-09-16 15:11:53'),
      total?: int32(name='Total', description='Indicates the number of tasks.', example='2'),
      tps?: int32(name='Tps', description='Indicates the number of transactions processed by the database per second.', example='0'),
    }(name='Full', description='Indicates information about full migration tasks.'),
    fullCheck?: {
      expired?: int32(name='Expired', description='Indicates the number of remaining days before the tasks expire.', example='0'),
      progress?: int32(name='Progress', description='Indicates the progress of the tasks.', example='0'),
      startTime?: string(name='StartTime', description='Indicates the start time when the tasks are performed.', example='2019-09-16 15:12:53'),
      total?: int32(name='Total', description='Indicates the number of tasks.', example='0'),
      tps?: int32(name='Tps', description='Indicates the number of transactions processed by the database per second.', example='0'),
    }(name='FullCheck', description='Indicates information about full check tasks.'),
    fullRevise?: {
      expired?: int32(name='Expired', description='Indicates the number of remaining days before the tasks expire.', example='0'),
      progress?: int32(name='Progress', description='Indicates the progress of the tasks.', example='0'),
      startTime?: string(name='StartTime', description='Indicates the start time when the tasks are performed.', example='2019-09-16 15:12:53'),
      total?: int32(name='Total', description='Indicates the number of tasks.', example='0'),
      tps?: int32(name='Tps', description='Indicates the number of transactions processed by the database per second.', example='0'),
    }(name='FullRevise', description='Indicates information about full correction tasks.'),
    increment?: {
      delay?: int32(name='Delay', description='Indicates the latency of the incremental data synchronization.', example='1568617906'),
      startTime?: string(name='StartTime', description='Indicates the start time when the incremental data synchronization is performed.', example='2019-09-16 15:12:53'),
      tps?: int32(name='Tps', description='Indicates the number of transactions processed by the database per second.', example='10'),
    }(name='Increment', description='Indicates information about incremental data synchronization.'),
    progress?: string(name='Progress', description='Indicates the incremental data synchronization progress.', example='70'),
    review?: {
      expired?: int32(name='Expired', description='Indicates the number of remaining days before the tasks expire.', example='0'),
      progress?: int32(name='Progress', description='Indicates the progress of the tasks.', example='0'),
      startTime?: string(name='StartTime', description='Indicates the start time when the tasks are performed.', example='2019-09-16 15:12:53'),
      total?: int32(name='Total', description='Indicates the number of tasks.', example='5'),
      tps?: int32(name='Tps', description='Indicates the number of transactions processed by the database per second.', example='10'),
    }(name='Review', description='Indicates check tasks.'),
    sourceTableName?: string(name='SourceTableName', description='Indicates the name of the table that you convert or shard.', example='a1'),
    stage?: string(name='Stage', description='Indicates the current stage of the task.', example='2'),
    status?: string(name='Status', description='Indicates the state of the tasks to shard tables or convert tables.'),
    targetTableName?: string(name='TargetTableName', description='Indicates the name of the table after you convert or shard the table.', example='a2'),
  }(name='Data', description='Indicates the data that is returned.'),
  requestId?: string(name='RequestId', description='Indicates the unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='5D64DE5944A1E541E0CB908A'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeShardTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeShardTaskInfoResponseBody(name='body'),
}

/**
 * @param request DescribeShardTaskInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeShardTaskInfoResponse
 */
async function describeShardTaskInfoWithOptions(request: DescribeShardTaskInfoRequest, runtime: $RuntimeOptions): DescribeShardTaskInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sourceTableName)) {
    query['SourceTableName'] = request.sourceTableName;
  }
  if (!$isNull(request.targetTableName)) {
    query['TargetTableName'] = request.targetTableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeShardTaskInfo',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeShardTaskInfoRequest
 * @return DescribeShardTaskInfoResponse
 */
async function describeShardTaskInfo(request: DescribeShardTaskInfoRequest): DescribeShardTaskInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeShardTaskInfoWithOptions(request, runtime);
}

model DescribeSqlFlashbakTaskRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds****c6vxxyzd'),
}

model DescribeSqlFlashbakTaskResponseBody = {
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='5D64DE59-44A1-E541-E0CB-B7E5C4305162'),
  sqlFlashbackTasks?: {
    sqlFlashbackTask?: [ 
    {
      dbName?: string(name='DbName', description='Indicates the name of the database on which a flashback task is performed.', example='drds_flashback'),
      downloadUrl?: string(name='DownloadUrl', description='Indicates the download URL.', example='http://...'),
      expireTime?: long(name='ExpireTime', description='Indicates the time when the download URL expires.', example='1569216270000'),
      gmtCreate?: long(name='GmtCreate', description='Indicates the point in time when the instance was created.', example='1568611408000'),
      gmtModified?: long(name='GmtModified', description='Indicates the point in time when the flashback task is performed.', example='1568611469000'),
      id?: long(name='Id', description='Indicates the ID of the primary key that corresponds to a table used in the flashback task.', example='238'),
      instId?: string(name='InstId', description='Indicates the ID of the instance.', example='drdshbga76p6****'),
      recallProgress?: int32(name='RecallProgress', description='Indicates the progress of the reverse call.', example='10'),
      recallRestoreType?: int32(name='RecallRestoreType', description='Indicates the type of the flashback task. Valid values:

*   **1**: image restoration
*   **2**: reverse restoration', example='1'),
      recallStatus?: int32(name='RecallStatus', description='Indicates the status of the data recall task.', example='1'),
      recallType?: int32(name='RecallType', description='Indicates the type of the reverse call. Valid values:

*   **0**: exact search
*   **1**: fuzzy search', example='1'),
      searchEndTime?: long(name='SearchEndTime', description='Indicates the start time of the reverse call.', example='1568509597000'),
      searchStartTime?: long(name='SearchStartTime', description='Indicates the end time of the reverse call.', example='1568609597000'),
      sqlCounter?: long(name='SqlCounter', description='Indicates the number of data rows that are flashed back.', example='0'),
      sqlPk?: string(name='SqlPk', description='Indicates the primary key specified in the SQL statements.', example='id'),
      sqlType?: string(name='SqlType', description='Indicates the types of the SQL statements.', example='Insert,Update,Delete'),
      tableName?: string(name='TableName', description='Indicates the name of the table that contains the data that are flashed back.', example='drds_params'),
      traceId?: string(name='TraceId', description='Indicates the ID of the trace of the SQL query.', example='trace'),
    }
  ](name='SqlFlashbackTask')
  }(name='SqlFlashbackTasks', description='Indicates the information about flashback tasks.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeSqlFlashbakTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSqlFlashbakTaskResponseBody(name='body'),
}

/**
 * @summary Queries the flashback tasks that are performed on a PolarDB-X 1.0 instance.
 *
 * @param request DescribeSqlFlashbakTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSqlFlashbakTaskResponse
 */
async function describeSqlFlashbakTaskWithOptions(request: DescribeSqlFlashbakTaskRequest, runtime: $RuntimeOptions): DescribeSqlFlashbakTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSqlFlashbakTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the flashback tasks that are performed on a PolarDB-X 1.0 instance.
 *
 * @param request DescribeSqlFlashbakTaskRequest
 * @return DescribeSqlFlashbakTaskResponse
 */
async function describeSqlFlashbakTask(request: DescribeSqlFlashbakTaskRequest): DescribeSqlFlashbakTaskResponse {
  var runtime = new $RuntimeOptions{};
  return describeSqlFlashbakTaskWithOptions(request, runtime);
}

model DescribeTableRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_flashback'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
  regionId?: string(name='RegionId', description='The ID of the region where the PolarDB-X 1.0 instance is created.', example='cn-hangzhou'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='employee_split'),
}

model DescribeTableResponseBody = {
  data?: {
    list?: [ 
      {
        columnName?: string(name='ColumnName', description='Indicates the name of a column.', example='Id'),
        columnType?: string(name='ColumnType', description='Indicates the type of the column.', example='bigint(20)'),
        extra?: string(name='Extra', description='Extra', example='auto_increment'),
        index?: string(name='Index', description='Indicates the primary key of the table.', example='PRI'),
        isAllowNull?: string(name='IsAllowNull', description='Indicates whether the column can be empty.', example='NO'),
        isPk?: string(name='IsPk', description='Indicates whether the column is the primary key column of the table.', example='YES'),
      }
    ](name='List', description='Indicates the details about the table schema.'),
  }(name='Data', description='Indicates the returned data.'),
  requestId?: string(name='RequestId', description='Indicates the unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='B5644ABB-559A-4A1C-83F2-9E7209******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DescribeTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableResponseBody(name='body'),
}

/**
 * @summary Queries information about the schema of a table.
 *
 * @param request DescribeTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableResponse
 */
async function describeTableWithOptions(request: DescribeTableRequest, runtime: $RuntimeOptions): DescribeTableResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTable',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about the schema of a table.
 *
 * @param request DescribeTableRequest
 * @return DescribeTableResponse
 */
async function describeTable(request: DescribeTableRequest): DescribeTableResponse {
  var runtime = new $RuntimeOptions{};
  return describeTableWithOptions(request, runtime);
}

model DescribeTableListByTypeRequest {
  currentPage?: int32(name='CurrentPage', description='The number of the page to return.', example='1'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='drds_flash****'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbga76p6****'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='10'),
  query?: string(name='Query', description='The field that you specify for your query.', example='drdshbga76p61861'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  tableType?: string(name='TableType', description='The type of tables. Valid values:

This parameter is required.', example='SINGLE'),
}

model DescribeTableListByTypeResponseBody = {
  list?: [ 
    {
      property?: string(name='Property', description='Indicates the property of a table.', example='single'),
      tableName?: string(name='TableName', description='Indicates the name of the table.', example='employee_split'),
    }
  ](name='List', description='Indicates the information about tables.'),
  pageNumber?: int32(name='PageNumber', description='Indicates the page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='Indicates the number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='Indicates the unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='B360F47B-59E3-4D1C-BA03-6BFB1C993F88'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: int32(name='Total', description='Indicates the total number of returned tables.', example='1'),
}

model DescribeTableListByTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableListByTypeResponseBody(name='body'),
}

/**
 * @param request DescribeTableListByTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableListByTypeResponse
 */
async function describeTableListByTypeWithOptions(request: DescribeTableListByTypeRequest, runtime: $RuntimeOptions): DescribeTableListByTypeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    query['Query'] = request.query;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableType)) {
    query['TableType'] = request.tableType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTableListByType',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeTableListByTypeRequest
 * @return DescribeTableListByTypeResponse
 */
async function describeTableListByType(request: DescribeTableListByTypeRequest): DescribeTableListByTypeResponse {
  var runtime = new $RuntimeOptions{};
  return describeTableListByTypeWithOptions(request, runtime);
}

model DescribeTablesRequest {
  currentPage?: int32(name='CurrentPage', description='The page number of the returned page.', example='1'),
  dbName?: string(name='DbName', description='The name of the database whose tables you want to query.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  pageSize?: int32(name='PageSize', description='The number of tables returned on each page.', example='10'),
  query?: string(name='Query', description='The query condition. The value of this parameter is the ID of the PolarDB-X 1.0 instance.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeTablesResponseBody = {
  list?: [ 
    {
      allowFullTableScan?: boolean(name='AllowFullTableScan', description='Indicates whether full table scanning is allowed.', example='false'),
      broadcast?: boolean(name='Broadcast', description='Indicates whether the table is a replicated table.', example='false'),
      dbInstType?: int32(name='DbInstType', description='The type of the PolarDB-X 1.0 instance. Valid values:

*   0: The instance is a dedicated instance.
*   1: The instance is a shard instance.', example='0'),
      isLocked?: boolean(name='IsLocked', description='Indicates whether the table is locked.', example='false'),
      isShard?: boolean(name='IsShard', description='Indicates whether the table is sharded.', example='false'),
      shardKey?: string(name='ShardKey', description='The shard key of the table.', example='null'),
      status?: int32(name='Status', description='Indicates whether sharding tasks are performed on the table. Valid values:

*   0: No sharding task is performed on the table.
*   1: Sharding tasks are performed on the table.', example='0'),
      table?: string(name='Table', description='The name of the table.', example='test'),
    }
  ](name='List', description='The list of returned tables.'),
  pageNumber?: int32(name='PageNumber', description='The number of returned pages.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of tables returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='83AC3D7E-461C-4D87-8ACD-6CC295******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  total?: int32(name='Total', description='The total number of returned tables.', example='1'),
}

model DescribeTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTablesResponseBody(name='body'),
}

/**
 * @summary DescribeTables文档变更
 *
 * @param request DescribeTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTablesResponse
 */
async function describeTablesWithOptions(request: DescribeTablesRequest, runtime: $RuntimeOptions): DescribeTablesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    query['Query'] = request.query;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTables',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary DescribeTables文档变更
 *
 * @param request DescribeTablesRequest
 * @return DescribeTablesResponse
 */
async function describeTables(request: DescribeTablesRequest): DescribeTablesResponse {
  var runtime = new $RuntimeOptions{};
  return describeTablesWithOptions(request, runtime);
}

model DisableSqlAuditRequest {
  dbName?: string(name='DbName', description='The name of the database for which you want to disable the SQL audit feature.

This parameter is required.', example='drds_test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***********'),
}

model DisableSqlAuditResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E273749A-9A33-44CF-ABE7-0CB19C******'),
  result?: boolean(name='Result', description='The return result.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model DisableSqlAuditResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableSqlAuditResponseBody(name='body'),
}

/**
 * @summary Disables the SQL audit feature for a database.
 *
 * @param request DisableSqlAuditRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableSqlAuditResponse
 */
async function disableSqlAuditWithOptions(request: DisableSqlAuditRequest, runtime: $RuntimeOptions): DisableSqlAuditResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableSqlAudit',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables the SQL audit feature for a database.
 *
 * @param request DisableSqlAuditRequest
 * @return DisableSqlAuditResponse
 */
async function disableSqlAudit(request: DisableSqlAuditRequest): DisableSqlAuditResponse {
  var runtime = new $RuntimeOptions{};
  return disableSqlAuditWithOptions(request, runtime);
}

model EnableInstanceIpv6AddressRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instance resides.', example='cn-hangzhou'),
}

model EnableInstanceIpv6AddressResponseBody = {
  data?: boolean(name='Data', description='The result of the request.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7E9F7F16-05B5-42DA-94D6-E36402******'),
}

model EnableInstanceIpv6AddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableInstanceIpv6AddressResponseBody(name='body'),
}

/**
 * @summary Creates an IPv6 address.
 *
 * @param request EnableInstanceIpv6AddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableInstanceIpv6AddressResponse
 */
async function enableInstanceIpv6AddressWithOptions(request: EnableInstanceIpv6AddressRequest, runtime: $RuntimeOptions): EnableInstanceIpv6AddressResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableInstanceIpv6Address',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an IPv6 address.
 *
 * @param request EnableInstanceIpv6AddressRequest
 * @return EnableInstanceIpv6AddressResponse
 */
async function enableInstanceIpv6Address(request: EnableInstanceIpv6AddressRequest): EnableInstanceIpv6AddressResponse {
  var runtime = new $RuntimeOptions{};
  return enableInstanceIpv6AddressWithOptions(request, runtime);
}

model EnableSqlAuditRequest {
  dbName?: string(name='DbName', description='The name of the database for which you want to enable the SQL audit feature.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds***********'),
  isRecall?: boolean(name='IsRecall', description='Specifies whether to backtrack historical SQL statements for auditing.', example='true'),
  recallEndTimestamp?: string(name='RecallEndTimestamp', description='The timestamp that indicates when the backtracking ends. Unit: milliseconds.

> The end time of the backtracking must be later than the start time of the backtracking.', example='1568875132000'),
  recallStartTimestamp?: string(name='RecallStartTimestamp', description='The timestamp that indicates when the backtracking starts. Unit: milliseconds.', example='1568875132000'),
}

model EnableSqlAuditResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='463A5F0F-12AD-4544-A902-B2B983******'),
  result?: boolean(name='Result', description='Indices whether the SQL audit feature is enabled.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model EnableSqlAuditResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableSqlAuditResponseBody(name='body'),
}

/**
 * @summary Enables the SQL audit feature for a database.
 *
 * @param request EnableSqlAuditRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableSqlAuditResponse
 */
async function enableSqlAuditWithOptions(request: EnableSqlAuditRequest, runtime: $RuntimeOptions): EnableSqlAuditResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.isRecall)) {
    query['IsRecall'] = request.isRecall;
  }
  if (!$isNull(request.recallEndTimestamp)) {
    query['RecallEndTimestamp'] = request.recallEndTimestamp;
  }
  if (!$isNull(request.recallStartTimestamp)) {
    query['RecallStartTimestamp'] = request.recallStartTimestamp;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableSqlAudit',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables the SQL audit feature for a database.
 *
 * @param request EnableSqlAuditRequest
 * @return EnableSqlAuditResponse
 */
async function enableSqlAudit(request: EnableSqlAuditRequest): EnableSqlAuditResponse {
  var runtime = new $RuntimeOptions{};
  return enableSqlAuditWithOptions(request, runtime);
}

model EnableSqlFlashbackMatchSwitchRequest {
  dbName?: string(name='DbName', description='The name of the database you want to back up.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the ApsaraDB RDS for PostgreSQL instance.

This parameter is required.', example='drds***********'),
}

model EnableSqlFlashbackMatchSwitchResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='463A5F0F-12AD-4544-A902-B2B983******'),
  result?: boolean(name='Result', description='Indicates whether SqlFlashbackMatchSwitch is enabled or not.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the request was sent successfully or not.', example='true'),
}

model EnableSqlFlashbackMatchSwitchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableSqlFlashbackMatchSwitchResponseBody(name='body'),
}

/**
 * @param request EnableSqlFlashbackMatchSwitchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableSqlFlashbackMatchSwitchResponse
 */
async function enableSqlFlashbackMatchSwitchWithOptions(request: EnableSqlFlashbackMatchSwitchRequest, runtime: $RuntimeOptions): EnableSqlFlashbackMatchSwitchResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableSqlFlashbackMatchSwitch',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EnableSqlFlashbackMatchSwitchRequest
 * @return EnableSqlFlashbackMatchSwitchResponse
 */
async function enableSqlFlashbackMatchSwitch(request: EnableSqlFlashbackMatchSwitchRequest): EnableSqlFlashbackMatchSwitchResponse {
  var runtime = new $RuntimeOptions{};
  return enableSqlFlashbackMatchSwitchWithOptions(request, runtime);
}

model FlashbackRecycleBinTableRequest {
  dbName?: string(name='DbName', description='The name of the database to which the table belongs.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance to which the table belongs.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  tableName?: string(name='TableName', description='The name of the logical table to be restored.

This parameter is required.', example='test'),
}

model FlashbackRecycleBinTableResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the deleted logical table is restored.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='463A5F0F-12AD-4544-A902-B2B983******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model FlashbackRecycleBinTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FlashbackRecycleBinTableResponseBody(name='body'),
}

/**
 * @summary Restores a logical table that is deleted.
 *
 * @param request FlashbackRecycleBinTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FlashbackRecycleBinTableResponse
 */
async function flashbackRecycleBinTableWithOptions(request: FlashbackRecycleBinTableRequest, runtime: $RuntimeOptions): FlashbackRecycleBinTableResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FlashbackRecycleBinTable',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restores a logical table that is deleted.
 *
 * @param request FlashbackRecycleBinTableRequest
 * @return FlashbackRecycleBinTableResponse
 */
async function flashbackRecycleBinTable(request: FlashbackRecycleBinTableRequest): FlashbackRecycleBinTableResponse {
  var runtime = new $RuntimeOptions{};
  return flashbackRecycleBinTableWithOptions(request, runtime);
}

model GetDrdsDbRdsRelationInfoRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='testDb'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drdshbga948vbpd2'),
}

model GetDrdsDbRdsRelationInfoResponseBody = {
  data?: [ 
    {
      rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the storage instance.', example='rm-bp16ad920ndxxxx02'),
      readOnlyInstanceInfo?: [ string ](name='ReadOnlyInstanceInfo', description='The IDs of the read-only storage instances.'),
      usedInstanceId?: string(name='UsedInstanceId', description='The ID of the storage instance that is in use. If the specified instance in the request is a primary DRDS instance, the value of this parameter is the ID of the primary storage instance. If the specified instance in the request is a read-only DRDS instance, the value of this parameter is the ID of the secondary storage instance.', example='rm-bp1l8xi1dd9xxxxbj'),
      usedInstanceType?: string(name='UsedInstanceType', description='The type of the storage instance that is in use.', example='RDS'),
    }
  ](name='Data', description='The structure information about the storage instances of the DRDS database. Each entry corresponds to a primary storage instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='82FD0D9B-9A65-40D3-B1D9-8851B1D4AF75'),
  success?: boolean(name='Success', description='Indicates whether the call was successful.', example='true'),
}

model GetDrdsDbRdsRelationInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDrdsDbRdsRelationInfoResponseBody(name='body'),
}

/**
 * @param request GetDrdsDbRdsRelationInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDrdsDbRdsRelationInfoResponse
 */
async function getDrdsDbRdsRelationInfoWithOptions(request: GetDrdsDbRdsRelationInfoRequest, runtime: $RuntimeOptions): GetDrdsDbRdsRelationInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDrdsDbRdsRelationInfo',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetDrdsDbRdsRelationInfoRequest
 * @return GetDrdsDbRdsRelationInfoResponse
 */
async function getDrdsDbRdsRelationInfo(request: GetDrdsDbRdsRelationInfoRequest): GetDrdsDbRdsRelationInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getDrdsDbRdsRelationInfoWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='Specify the token that is used to display the returned tags on multiple pages.', example='6ab4640a-479b-41d0-ad3c-c6e888bc3d8f'),
  regionId?: string(name='RegionId', description='The ID of the region in which the resource is located.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to INSTANCE.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that you want to query.', example='color'),
      value?: string(name='Value', description='The value of the tag that you want to query.', example='red'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The token that is used to display the returned tags on multiple pages.', example='6ab4640a-479b-41d0-ad3c-c6e888bc3d8f'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='58CE1CB0-F0F4-4BA3-B876-135DC47DF52F'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='drdshzsd11****'),
      resourceType?: string(name='ResourceType', description='The resource type. The value of this parameter is fixed to INSTANCE.', example='INSTANCE'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='test'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='1'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The list of returned tags.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ManagePrivateRdsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the custom ApsaraDB RDS instance at the storage layer.

> You can call the [DescribeDrdsRdsInstances](https://help.aliyun.com/document_detail/215526.html) operation to query the details of all ApsaraDB RDS instances, including the ID of the instance.

This parameter is required.', example='rm-***************'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

> You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to query the details of all PolarDB-X 1.0 instances within an Alibaba Cloud account, including the IDs of the instances.

This parameter is required.', example='drds*************'),
  params?: string(name='Params', description='The JSON string that consists of request parameters and the values of the request parameters of an operation that you need to call for the custom ApsaraDB RDS instance. The value of a request parameter is of the STRING type. Example: `{NodeId:"1797****"}`.

For more information about the request parameters and valid values of the request parameters of each operation, see the request parameter sections in the following topics:

*   [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/26231.html)
*   [DescribeAvailableClasses](https://help.aliyun.com/document_detail/196546.html)
*   [DescribeSQLCollectorPolicy](https://help.aliyun.com/document_detail/26292.html)
*   [ModifySQLCollectorPolicy](https://help.aliyun.com/document_detail/26293.html)
*   [DescribeParameters](https://help.aliyun.com/document_detail/26285.html)
*   [ModifyParameter](https://help.aliyun.com/document_detail/26286.html)
*   [DescribeDBInstanceHAConfig](https://help.aliyun.com/document_detail/26244.html)
*   [SwitchDBInstanceHA](https://help.aliyun.com/document_detail/26251.html)

> Among the required request parameters of the preceding operations, you do not need to specify the `Action` and `DBInstanceId` parameters. You must specify all the other required request parameters.', example='{NodeId:"1797****"}'),
  rdsAction?: string(name='RdsAction', description='The operation that you want to perform on the custom ApsaraDB RDS instance. Valid values:

*   **DescribeDBInstanceAttribute**: queries the details of the custom ApsaraDB RDS instance.
*   **DescribeAvailableClasses**: queries the specifications that are supported for a custom ApsaraDB RDS instance. The specifications include the instance type and the storage capacity.
*   **DescribeSQLCollectorPolicy**: queries whether the SQL Explorer (SQL Audit) feature is enabled for custom ApsaraDB RDS instance.
*   **ModifySQLCollectorPolicy**: enables or disables the SQL Explorer (SQL Audit) feature for the custom ApsaraDB RDS instance.
*   **DescribeParameters**: queries the parameter settings of the custom ApsaraDB RDS instance.
*   **ModifyParameter**: modifies the parameters of the custom ApsaraDB RDS instance.
*   **DescribeDBInstanceHAConfig**: queries the high availability mode and data replication mode of the custom ApsaraDB RDS instance.
*   **SwitchDBInstanceHA**: switches workloads between the primary and secondary custom ApsaraDB RDS instances.

This parameter is required.', example='SwitchDBInstanceHA'),
  regionId?: string(name='RegionId', description='The ID of the region in which the PolarDB-X 1.0 instance resides.

> You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to query the details of all PolarDB-X 1.0 instances within an Alibaba Cloud account, including the IDs of regions in which the instances reside.', example='cn-hanzhou'),
}

model ManagePrivateRdsResponseBody = {
  data?: string(name='Data', description='The parameter result set returned for the operation that is called for the custom ApsaraDB RDS instance.', example='{"requestId":"E63C810A-4A13-47B6-BA67-C0E23A******"}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0237BCD2-2C7A-4F86-A766-657AF6******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ManagePrivateRdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ManagePrivateRdsResponseBody(name='body'),
}

/**
 * @summary Manages a custom ApsaraDB RDS instance at the storage layer.
 *
 * @param request ManagePrivateRdsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ManagePrivateRdsResponse
 */
async function managePrivateRdsWithOptions(request: ManagePrivateRdsRequest, runtime: $RuntimeOptions): ManagePrivateRdsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.params)) {
    query['Params'] = request.params;
  }
  if (!$isNull(request.rdsAction)) {
    query['RdsAction'] = request.rdsAction;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ManagePrivateRds',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Manages a custom ApsaraDB RDS instance at the storage layer.
 *
 * @param request ManagePrivateRdsRequest
 * @return ManagePrivateRdsResponse
 */
async function managePrivateRds(request: ManagePrivateRdsRequest): ManagePrivateRdsResponse {
  var runtime = new $RuntimeOptions{};
  return managePrivateRdsWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountName?: string(name='AccountName', description='The name of the member account.

This parameter is required.', example='test'),
  description?: string(name='Description', description='The description of the account.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the ApsaraDB RDS for PostgreSQL instance.

This parameter is required.', example='drds************'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F93CCD5-806F-4470-BBC7-20476A******'),
  success?: boolean(name='Success', description='Indicates whether the request was sent successfully or not.', example='true'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: $RuntimeOptions): ModifyAccountDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountDescription',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyAccountPrivilegeRequest {
  accountName?: string(name='AccountName', description='The username of the account that you want to modify.

This parameter is required.', example='account_sec'),
  dbPrivilege?: [ 
    {
      dbName?: string(name='DbName', description='The name of the database that you want to manage by using the account to modify.', example='test123'),
      privilege?: string(name='Privilege', description='The permissions that you want to grant to the account.', example='ReadWrite'),
    }
  ](name='DbPrivilege'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbgaen89****'),
  regionId?: string(name='RegionId', description='The ID of the region in which the PolarDB-X 1.0 instance is located.', example='cn-hangzhou'),
}

model ModifyAccountPrivilegeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='73559800-3c8c-11ec-bd40-99cfcff3fe1e'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model ModifyAccountPrivilegeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountPrivilegeResponseBody(name='body'),
}

/**
 * @param request ModifyAccountPrivilegeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountPrivilegeResponse
 */
async function modifyAccountPrivilegeWithOptions(request: ModifyAccountPrivilegeRequest, runtime: $RuntimeOptions): ModifyAccountPrivilegeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.dbPrivilege)) {
    query['DbPrivilege'] = request.dbPrivilege;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountPrivilege',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAccountPrivilegeRequest
 * @return ModifyAccountPrivilegeResponse
 */
async function modifyAccountPrivilege(request: ModifyAccountPrivilegeRequest): ModifyAccountPrivilegeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountPrivilegeWithOptions(request, runtime);
}

model ModifyDrdsInstanceDescriptionRequest {
  description?: string(name='Description', description='The description of the DRDS instance.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
}

model ModifyDrdsInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='C44CA24C-C7C4-4C0F-8AC9-1343F2******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ModifyDrdsInstanceDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDrdsInstanceDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyDrdsInstanceDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDrdsInstanceDescriptionResponse
 */
async function modifyDrdsInstanceDescriptionWithOptions(request: ModifyDrdsInstanceDescriptionRequest, runtime: $RuntimeOptions): ModifyDrdsInstanceDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDrdsInstanceDescription',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyDrdsInstanceDescriptionRequest
 * @return ModifyDrdsInstanceDescriptionResponse
 */
async function modifyDrdsInstanceDescription(request: ModifyDrdsInstanceDescriptionRequest): ModifyDrdsInstanceDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDrdsInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDrdsIpWhiteListRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the Message Queue for Apache Kafka instance.

This parameter is required.', example='drds****c6vxxyzd'),
  groupAttribute?: string(name='GroupAttribute', description='The attribute of the IP address whitelist group.'),
  groupName?: string(name='GroupName', description='The name of the IP address whitelist group.', example='drds_******'),
  ipWhiteList?: string(name='IpWhiteList', description='The modified whitelist. Separate multiple IP addresses with commas (,).

This parameter is required.', example='127.***.***.***,10.***.***.***'),
  mode?: boolean(name='Mode', description='Specifies the mode. Valid values:

*   `True`: append modifications
*   `False`: overwrite modification', example='false'),
}

model ModifyDrdsIpWhiteListResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='933A1EC2-8260-4D4F-A56A-73BA27******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ModifyDrdsIpWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDrdsIpWhiteListResponseBody(name='body'),
}

/**
 * @param request ModifyDrdsIpWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDrdsIpWhiteListResponse
 */
async function modifyDrdsIpWhiteListWithOptions(request: ModifyDrdsIpWhiteListRequest, runtime: $RuntimeOptions): ModifyDrdsIpWhiteListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.groupAttribute)) {
    query['GroupAttribute'] = request.groupAttribute;
  }
  if (!$isNull(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!$isNull(request.ipWhiteList)) {
    query['IpWhiteList'] = request.ipWhiteList;
  }
  if (!$isNull(request.mode)) {
    query['Mode'] = request.mode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDrdsIpWhiteList',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyDrdsIpWhiteListRequest
 * @return ModifyDrdsIpWhiteListResponse
 */
async function modifyDrdsIpWhiteList(request: ModifyDrdsIpWhiteListRequest): ModifyDrdsIpWhiteListResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDrdsIpWhiteListWithOptions(request, runtime);
}

model ModifyPolarDbReadWeightRequest {
  dbInstanceId?: string(name='DbInstanceId', description='Polar cluster ID.

This parameter is required.', example='pc-****************'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  dbNodeIds?: string(name='DbNodeIds', description='The node list in the destination apsaradb for PolarDB cluster. The nodes in each cluster are separated with commas (,) and colons (:).

This parameter is required.', example='pi-****************,pi-****************:pi-****************'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds************'),
  weights?: string(name='Weights', description='The weight of the PolarDB cluster. Separate multiple weights with commas (,).

This parameter is required.', example='14,86'),
}

model ModifyPolarDbReadWeightResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='B12FC174-D5CE-4A6E-83C1-0F8F86******'),
  success?: boolean(name='Success', description='Indicates whether the database creation failure records were removed from the PolarDB-X instance.', example='true'),
}

model ModifyPolarDbReadWeightResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPolarDbReadWeightResponseBody(name='body'),
}

/**
 * @param request ModifyPolarDbReadWeightRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyPolarDbReadWeightResponse
 */
async function modifyPolarDbReadWeightWithOptions(request: ModifyPolarDbReadWeightRequest, runtime: $RuntimeOptions): ModifyPolarDbReadWeightResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.dbNodeIds)) {
    query['DbNodeIds'] = request.dbNodeIds;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.weights)) {
    query['Weights'] = request.weights;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyPolarDbReadWeight',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyPolarDbReadWeightRequest
 * @return ModifyPolarDbReadWeightResponse
 */
async function modifyPolarDbReadWeight(request: ModifyPolarDbReadWeightRequest): ModifyPolarDbReadWeightResponse {
  var runtime = new $RuntimeOptions{};
  return modifyPolarDbReadWeightWithOptions(request, runtime);
}

model ModifyRdsReadWeightRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  instanceNames?: string(name='InstanceNames', description='The names of the ApsaraDB RDS for MySQL instances. Separate the names with commas (,).

This parameter is required.', example='rm-****************,rm-****************'),
  weights?: string(name='Weights', description='The weights of the ApsaraDB RDS for MySQL instances. Separate the weights with commas (,).

This parameter is required.', example='14,86'),
}

model ModifyRdsReadWeightResponseBody = {
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='B12FC174-D5CE-4A6E-83C1-0F8F86******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model ModifyRdsReadWeightResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyRdsReadWeightResponseBody(name='body'),
}

/**
 * @param request ModifyRdsReadWeightRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyRdsReadWeightResponse
 */
async function modifyRdsReadWeightWithOptions(request: ModifyRdsReadWeightRequest, runtime: $RuntimeOptions): ModifyRdsReadWeightResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.instanceNames)) {
    query['InstanceNames'] = request.instanceNames;
  }
  if (!$isNull(request.weights)) {
    query['Weights'] = request.weights;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyRdsReadWeight',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyRdsReadWeightRequest
 * @return ModifyRdsReadWeightResponse
 */
async function modifyRdsReadWeight(request: ModifyRdsReadWeightRequest): ModifyRdsReadWeightResponse {
  var runtime = new $RuntimeOptions{};
  return modifyRdsReadWeightWithOptions(request, runtime);
}

model PutStartBackupRequest {
  backupDbNames?: string(name='BackupDbNames', description='If you need to back up data at the database level, you must specify the list of databases to be backed up, and separate multiple databases with commas (,).', example='db_1, db_2'),
  backupLevel?: string(name='BackupLevel', description='The backup level. Valid values:

*   instance: instance
*   db: The database type.', example='db'),
  backupMode?: string(name='BackupMode', description='The backup mode. For more information, see [backup mode](https://help.aliyun.com/document_detail/108631.html) and the valid values are as follows:

*   phy: fast backup
*   logic: Consistent backup', example='phy'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds****c6vxxyzd'),
}

model PutStartBackupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D64DE5944A1E541E0******'),
  result?: string(name='Result', description='Indicates whether the backup task was submitted.', example='success'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model PutStartBackupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutStartBackupResponseBody(name='body'),
}

/**
 * @param request PutStartBackupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutStartBackupResponse
 */
async function putStartBackupWithOptions(request: PutStartBackupRequest, runtime: $RuntimeOptions): PutStartBackupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupDbNames)) {
    query['BackupDbNames'] = request.backupDbNames;
  }
  if (!$isNull(request.backupLevel)) {
    query['BackupLevel'] = request.backupLevel;
  }
  if (!$isNull(request.backupMode)) {
    query['BackupMode'] = request.backupMode;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PutStartBackup',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PutStartBackupRequest
 * @return PutStartBackupResponse
 */
async function putStartBackup(request: PutStartBackupRequest): PutStartBackupResponse {
  var runtime = new $RuntimeOptions{};
  return putStartBackupWithOptions(request, runtime);
}

model RefreshDrdsAtomUrlRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
}

model RefreshDrdsAtomUrlResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='B12FC174-D5CE-4A6E-83C1-0F8F86******'),
  result?: boolean(name='Result', description='Indicates whether the connection after refresh was successful.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RefreshDrdsAtomUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshDrdsAtomUrlResponseBody(name='body'),
}

/**
 * @param request RefreshDrdsAtomUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshDrdsAtomUrlResponse
 */
async function refreshDrdsAtomUrlWithOptions(request: RefreshDrdsAtomUrlRequest, runtime: $RuntimeOptions): RefreshDrdsAtomUrlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshDrdsAtomUrl',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RefreshDrdsAtomUrlRequest
 * @return RefreshDrdsAtomUrlResponse
 */
async function refreshDrdsAtomUrl(request: RefreshDrdsAtomUrlRequest): RefreshDrdsAtomUrlResponse {
  var runtime = new $RuntimeOptions{};
  return refreshDrdsAtomUrlWithOptions(request, runtime);
}

model ReleaseInstanceInternetAddressRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The region where the instance is located.', example='cn-beijing'),
}

model ReleaseInstanceInternetAddressResponseBody = {
  data?: boolean(name='Data', description='The result returned by the current API.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FD17CD3C-3355-49E8-9231-FE2DB0******'),
}

model ReleaseInstanceInternetAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseInstanceInternetAddressResponseBody(name='body'),
}

/**
 * @param request ReleaseInstanceInternetAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseInstanceInternetAddressResponse
 */
async function releaseInstanceInternetAddressWithOptions(request: ReleaseInstanceInternetAddressRequest, runtime: $RuntimeOptions): ReleaseInstanceInternetAddressResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseInstanceInternetAddress',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseInstanceInternetAddressRequest
 * @return ReleaseInstanceInternetAddressResponse
 */
async function releaseInstanceInternetAddress(request: ReleaseInstanceInternetAddressRequest): ReleaseInstanceInternetAddressResponse {
  var runtime = new $RuntimeOptions{};
  return releaseInstanceInternetAddressWithOptions(request, runtime);
}

model RemoveBackupsSetRequest {
  backupId?: string(name='BackupId', description='The ID of the backup set. You can call the [DescribeBackupSets](https://help.aliyun.com/document_detail/139331.html) interface to query the ID of a backup set.

This parameter is required.', example='ba30d5c4-a6dc-11ea-bd40-************'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
}

model RemoveBackupsSetResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='70FED5BE-4DDC-4556-AD35-5A6D27******'),
  result?: string(name='Result', description='Indicates whether SQL audit was disabled for the DRDS database.', example='success'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RemoveBackupsSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveBackupsSetResponseBody(name='body'),
}

/**
 * @param request RemoveBackupsSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveBackupsSetResponse
 */
async function removeBackupsSetWithOptions(request: RemoveBackupsSetRequest, runtime: $RuntimeOptions): RemoveBackupsSetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveBackupsSet',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveBackupsSetRequest
 * @return RemoveBackupsSetResponse
 */
async function removeBackupsSet(request: RemoveBackupsSetRequest): RemoveBackupsSetResponse {
  var runtime = new $RuntimeOptions{};
  return removeBackupsSetWithOptions(request, runtime);
}

model RemoveDrdsDbRequest {
  dbName?: string(name='DbName', description='The name of the database you want to back up.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance to which the destination database belongs.

This parameter is required.', example='drds************'),
}

model RemoveDrdsDbResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='B12FC174-D5CE-4A6E-83C1-0F8F86******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RemoveDrdsDbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveDrdsDbResponseBody(name='body'),
}

/**
 * @param request RemoveDrdsDbRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveDrdsDbResponse
 */
async function removeDrdsDbWithOptions(request: RemoveDrdsDbRequest, runtime: $RuntimeOptions): RemoveDrdsDbResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveDrdsDb',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveDrdsDbRequest
 * @return RemoveDrdsDbResponse
 */
async function removeDrdsDb(request: RemoveDrdsDbRequest): RemoveDrdsDbResponse {
  var runtime = new $RuntimeOptions{};
  return removeDrdsDbWithOptions(request, runtime);
}

model RemoveDrdsDbFailedRecordRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the ApsaraDB RDS for PostgreSQL instance.

This parameter is required.', example='drds************'),
}

model RemoveDrdsDbFailedRecordResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='D98BC610-5A91-453A-BC44-5873EF******'),
  result?: boolean(name='Result', description='Indicates whether the database creation failure records were deleted from the DRDS instance.', example='true'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RemoveDrdsDbFailedRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveDrdsDbFailedRecordResponseBody(name='body'),
}

/**
 * @param request RemoveDrdsDbFailedRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveDrdsDbFailedRecordResponse
 */
async function removeDrdsDbFailedRecordWithOptions(request: RemoveDrdsDbFailedRecordRequest, runtime: $RuntimeOptions): RemoveDrdsDbFailedRecordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveDrdsDbFailedRecord',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveDrdsDbFailedRecordRequest
 * @return RemoveDrdsDbFailedRecordResponse
 */
async function removeDrdsDbFailedRecord(request: RemoveDrdsDbFailedRecordRequest): RemoveDrdsDbFailedRecordResponse {
  var runtime = new $RuntimeOptions{};
  return removeDrdsDbFailedRecordWithOptions(request, runtime);
}

model RemoveDrdsInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drds************'),
}

model RemoveDrdsInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RemoveDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveDrdsInstanceResponseBody(name='body'),
}

/**
 * @summary Releases an instance.
 *
 * @description > *   You can call this operation to release an instance that is charged based on only the pay-as-you-go billing method.
 * >*   If the specifications of the instance are being changed, or one or more databases exist in the instance, you cannot call this operation to release the instance.
 *
 * @param request RemoveDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveDrdsInstanceResponse
 */
async function removeDrdsInstanceWithOptions(request: RemoveDrdsInstanceRequest, runtime: $RuntimeOptions): RemoveDrdsInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveDrdsInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases an instance.
 *
 * @description > *   You can call this operation to release an instance that is charged based on only the pay-as-you-go billing method.
 * >*   If the specifications of the instance are being changed, or one or more databases exist in the instance, you cannot call this operation to release the instance.
 *
 * @param request RemoveDrdsInstanceRequest
 * @return RemoveDrdsInstanceResponse
 */
async function removeDrdsInstance(request: RemoveDrdsInstanceRequest): RemoveDrdsInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return removeDrdsInstanceWithOptions(request, runtime);
}

model RemoveInstanceAccountRequest {
  accountName?: string(name='AccountName', description='The name of the member account.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds***********'),
}

model RemoveInstanceAccountResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RemoveInstanceAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveInstanceAccountResponseBody(name='body'),
}

/**
 * @param request RemoveInstanceAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveInstanceAccountResponse
 */
async function removeInstanceAccountWithOptions(request: RemoveInstanceAccountRequest, runtime: $RuntimeOptions): RemoveInstanceAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveInstanceAccount',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveInstanceAccountRequest
 * @return RemoveInstanceAccountResponse
 */
async function removeInstanceAccount(request: RemoveInstanceAccountRequest): RemoveInstanceAccountResponse {
  var runtime = new $RuntimeOptions{};
  return removeInstanceAccountWithOptions(request, runtime);
}

model RemoveRecycleBinTableRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  tableName?: string(name='TableName', description='The name of the logical table.', example='test'),
}

model RemoveRecycleBinTableResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the table in the recycle bin is deleted.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model RemoveRecycleBinTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveRecycleBinTableResponseBody(name='body'),
}

/**
 * @summary Deletes a table in the recycle bin.
 *
 * @param request RemoveRecycleBinTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveRecycleBinTableResponse
 */
async function removeRecycleBinTableWithOptions(request: RemoveRecycleBinTableRequest, runtime: $RuntimeOptions): RemoveRecycleBinTableResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveRecycleBinTable',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a table in the recycle bin.
 *
 * @param request RemoveRecycleBinTableRequest
 * @return RemoveRecycleBinTableResponse
 */
async function removeRecycleBinTable(request: RemoveRecycleBinTableRequest): RemoveRecycleBinTableResponse {
  var runtime = new $RuntimeOptions{};
  return removeRecycleBinTableWithOptions(request, runtime);
}

model RestartDrdsInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds************'),
}

model RestartDrdsInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='Indicates whether the database creation failure records were removed from the PolarDB-X instance.', example='true'),
  taskId?: long(name='TaskId', description='The ID of the task.', example='1'),
}

model RestartDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartDrdsInstanceResponseBody(name='body'),
}

/**
 * @param request RestartDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartDrdsInstanceResponse
 */
async function restartDrdsInstanceWithOptions(request: RestartDrdsInstanceRequest, runtime: $RuntimeOptions): RestartDrdsInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartDrdsInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RestartDrdsInstanceRequest
 * @return RestartDrdsInstanceResponse
 */
async function restartDrdsInstance(request: RestartDrdsInstanceRequest): RestartDrdsInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restartDrdsInstanceWithOptions(request, runtime);
}

model RollbackInstanceVersionRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The instance ID.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model RollbackInstanceVersionResponseBody = {
  data?: string(name='Data', description='Indicates whether the instance version was rolled back.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
}

model RollbackInstanceVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RollbackInstanceVersionResponseBody(name='body'),
}

/**
 * @param request RollbackInstanceVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RollbackInstanceVersionResponse
 */
async function rollbackInstanceVersionWithOptions(request: RollbackInstanceVersionRequest, runtime: $RuntimeOptions): RollbackInstanceVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RollbackInstanceVersion',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RollbackInstanceVersionRequest
 * @return RollbackInstanceVersionResponse
 */
async function rollbackInstanceVersion(request: RollbackInstanceVersionRequest): RollbackInstanceVersionResponse {
  var runtime = new $RuntimeOptions{};
  return rollbackInstanceVersionWithOptions(request, runtime);
}

model SetBackupLocalRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdshbgag23d13fds'),
  highSpaceUsageProtection?: string(name='HighSpaceUsageProtection', description='Specifies whether to enable the feature to forcibly delete binary log files if the used storage space reaches 90% of the total storage space or the remaining storage space is less than 5 GB. Valid values: 1 and 0. A value of 1 specifies to enable this feature. A value of 0 specifies not to enable this feature.', example='80'),
  localLogRetentionHours?: string(name='LocalLogRetentionHours', description='The number of hours for which log backup files are retained on the instance. Valid values: 0 to 168. Default value: 18. A value of 0 indicates that log backup files are not retained.', example='12'),
  localLogRetentionSpace?: string(name='LocalLogRetentionSpace', description='The maximum storage space usage that is allowed for log files on the instance. Valid values: 0 to 50. Default value: 30.', example='30'),
}

model SetBackupLocalResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6F70CE62-5077-4B7B-95BC-4DAC45614DBE'),
  result?: string(name='Result', description='The result returned.', example='success'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SetBackupLocalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetBackupLocalResponseBody(name='body'),
}

/**
 * @summary Modifies a backup policy.
 *
 * @param request SetBackupLocalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetBackupLocalResponse
 */
async function setBackupLocalWithOptions(request: SetBackupLocalRequest, runtime: $RuntimeOptions): SetBackupLocalResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.highSpaceUsageProtection)) {
    query['HighSpaceUsageProtection'] = request.highSpaceUsageProtection;
  }
  if (!$isNull(request.localLogRetentionHours)) {
    query['LocalLogRetentionHours'] = request.localLogRetentionHours;
  }
  if (!$isNull(request.localLogRetentionSpace)) {
    query['LocalLogRetentionSpace'] = request.localLogRetentionSpace;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetBackupLocal',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies a backup policy.
 *
 * @param request SetBackupLocalRequest
 * @return SetBackupLocalResponse
 */
async function setBackupLocal(request: SetBackupLocalRequest): SetBackupLocalResponse {
  var runtime = new $RuntimeOptions{};
  return setBackupLocalWithOptions(request, runtime);
}

model SetBackupPolicyRequest {
  backupDbNames?: string(name='BackupDbNames', description='The databases to be backed up. Separate multiple databases with commas (,).

>  This parameter takes effect only when the backup level is database level.', example='test1,test2'),
  backupLevel?: string(name='BackupLevel', description='The level of the backup. Valid values:

*   db: The database type.
*   instance: instance', example='db'),
  backupLog?: string(name='BackupLog', description='Specifies whether to enable log Backup. Valid values:

*   1: enabled.
*   0: disabled.', example='1'),
  backupMode?: string(name='BackupMode', description='The backup mode. Valid values:

*   **Logic **: logical backup
*   **phy**: physical backup', example='phy'),
  dataBackupRetentionPeriod?: string(name='DataBackupRetentionPeriod', description='The retention period of the backup data. Value range: 7 to 730.', example='7'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drds************'),
  logBackupRetentionPeriod?: string(name='LogBackupRetentionPeriod', description='The log retention period. Valid values: 7 to 730. This value must be less than or equal to the number of data backup days.', example='7'),
  preferredBackupEndTime?: string(name='PreferredBackupEndTime', description='The end time of the backup.', example='12:30:30'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The backup cycle. Valid values:

*   0: Monday
*   1: Tuesday
*   2: Wednesday
*   3: Thursday
*   4: Friday
*   5: Saturday
*   6: Sunday', example='0'),
  preferredBackupStartTime?: string(name='PreferredBackupStartTime', description='The start time of the backup.', example='11:30:30'),
}

model SetBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  result?: string(name='Result', description='Indicates whether the backup policy was successfully configured.', example='success'),
  success?: boolean(name='Success', description='Indicates whether the database creation failure records were removed from the DRDS instance.', example='true'),
}

model SetBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetBackupPolicyResponseBody(name='body'),
}

/**
 * @param request SetBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetBackupPolicyResponse
 */
async function setBackupPolicyWithOptions(request: SetBackupPolicyRequest, runtime: $RuntimeOptions): SetBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupDbNames)) {
    query['BackupDbNames'] = request.backupDbNames;
  }
  if (!$isNull(request.backupLevel)) {
    query['BackupLevel'] = request.backupLevel;
  }
  if (!$isNull(request.backupLog)) {
    query['BackupLog'] = request.backupLog;
  }
  if (!$isNull(request.backupMode)) {
    query['BackupMode'] = request.backupMode;
  }
  if (!$isNull(request.dataBackupRetentionPeriod)) {
    query['DataBackupRetentionPeriod'] = request.dataBackupRetentionPeriod;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.logBackupRetentionPeriod)) {
    query['LogBackupRetentionPeriod'] = request.logBackupRetentionPeriod;
  }
  if (!$isNull(request.preferredBackupEndTime)) {
    query['PreferredBackupEndTime'] = request.preferredBackupEndTime;
  }
  if (!$isNull(request.preferredBackupPeriod)) {
    query['PreferredBackupPeriod'] = request.preferredBackupPeriod;
  }
  if (!$isNull(request.preferredBackupStartTime)) {
    query['PreferredBackupStartTime'] = request.preferredBackupStartTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetBackupPolicy',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SetBackupPolicyRequest
 * @return SetBackupPolicyResponse
 */
async function setBackupPolicy(request: SetBackupPolicyRequest): SetBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return setBackupPolicyWithOptions(request, runtime);
}

model SetupBroadcastTablesRequest {
  active?: boolean(name='Active', description='Specifies whether to activate a broadcast table for the database.

This parameter is required.', example='true'),
  dbName?: string(name='DbName', description='The name of the database for which you want to configure a broadcast table.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region in which the PolarDB-X 1.0 instance resides.', example='cn-hangzhou'),
  tableName?: [ string ](name='TableName', description='The name of the table.

This parameter is required.', example='test'),
}

model SetupBroadcastTablesResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the broadcast table is configured.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model SetupBroadcastTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetupBroadcastTablesResponseBody(name='body'),
}

/**
 * @summary Configures a broadcast table for a database.
 *
 * @param request SetupBroadcastTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetupBroadcastTablesResponse
 */
async function setupBroadcastTablesWithOptions(request: SetupBroadcastTablesRequest, runtime: $RuntimeOptions): SetupBroadcastTablesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.active)) {
    query['Active'] = request.active;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetupBroadcastTables',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Configures a broadcast table for a database.
 *
 * @param request SetupBroadcastTablesRequest
 * @return SetupBroadcastTablesResponse
 */
async function setupBroadcastTables(request: SetupBroadcastTablesRequest): SetupBroadcastTablesResponse {
  var runtime = new $RuntimeOptions{};
  return setupBroadcastTablesWithOptions(request, runtime);
}

model SetupDrdsParamsRequest {
  data?: [ 
    {
      dbName?: string(name='DbName', description='The name of the parameter that you want to configure for a database.', example='test_db'),
      paramRanges?: string(name='ParamRanges', description='The valid values of the parameter.', example='[true|false]'),
      paramType?: string(name='ParamType', description='The type of the parameter that you want to configure. Valid values:

*   **ATOM**: the configuration item in the layer-3 data source.
*   **CONFIG**: the configuration item in ConfigServer.
*   **DIAMOND**: the configuration item in Diamond.', example='ATOM'),
      paramValue?: string(name='ParamValue', description='The value of parameter that you want to configure.', example='true'),
      paramVariableName?: string(name='ParamVariableName', description='The name of the parameter that you want to configure.', example='FORBID_EXECUTE_DML_ALL'),
    }
  ](name='Data', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance for which you want to configure parameters.

This parameter is required.', example='drdsjiii1b49****'),
  paramLevel?: string(name='ParamLevel', description='The resource for which you want to configure parameters. Valid values:

*   **INSTANCE**: Configure parameters for the instance.
*   **DB**: Configure parameters for the databases of the instance.

This parameter is required.', example='DB'),
  regionId?: string(name='RegionId', description='The ID of the region in which the PolarDB-X 1.0 instance is located.', example='cn-hangzhou'),
}

model SetupDrdsParamsResponseBody = {
  data?: boolean(name='Data', description='The returned results.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model SetupDrdsParamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetupDrdsParamsResponseBody(name='body'),
}

/**
 * @param request SetupDrdsParamsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetupDrdsParamsResponse
 */
async function setupDrdsParamsWithOptions(request: SetupDrdsParamsRequest, runtime: $RuntimeOptions): SetupDrdsParamsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.data)) {
    query['Data'] = request.data;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.paramLevel)) {
    query['ParamLevel'] = request.paramLevel;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetupDrdsParams',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SetupDrdsParamsRequest
 * @return SetupDrdsParamsResponse
 */
async function setupDrdsParams(request: SetupDrdsParamsRequest): SetupDrdsParamsResponse {
  var runtime = new $RuntimeOptions{};
  return setupDrdsParamsWithOptions(request, runtime);
}

model SetupRecycleBinStatusRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  statusAction?: string(name='StatusAction', description='Specifies the status of the table recycle bin. Valid values:

*   enable: The table recycle bin is enabled.
*   disable: The table recycle bin is disabled.

This parameter is required.', example='enable'),
}

model SetupRecycleBinStatusResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the table recycle bin is enabled.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model SetupRecycleBinStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetupRecycleBinStatusResponseBody(name='body'),
}

/**
 * @summary Enables the table recycle bin for a database.
 *
 * @param request SetupRecycleBinStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetupRecycleBinStatusResponse
 */
async function setupRecycleBinStatusWithOptions(request: SetupRecycleBinStatusRequest, runtime: $RuntimeOptions): SetupRecycleBinStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.statusAction)) {
    query['StatusAction'] = request.statusAction;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetupRecycleBinStatus',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables the table recycle bin for a database.
 *
 * @param request SetupRecycleBinStatusRequest
 * @return SetupRecycleBinStatusResponse
 */
async function setupRecycleBinStatus(request: SetupRecycleBinStatusRequest): SetupRecycleBinStatusResponse {
  var runtime = new $RuntimeOptions{};
  return setupRecycleBinStatusWithOptions(request, runtime);
}

model SetupTableRequest {
  allowFullTableScan?: boolean(name='AllowFullTableScan', description='Specifies whether to enable full table scan.

This parameter is required.', example='true'),
  dbName?: string(name='DbName', description='The name of the database in which the table resides.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='drds************'),
  regionId?: string(name='RegionId', description='The ID of the region where the streaming domain resides.', example='cn-hangzhou'),
  tableName?: [ string ](name='TableName', description='This parameter is required.', example='test'),
}

model SetupTableResponseBody = {
  data?: boolean(name='Data', description='Specifies whether to use a full table scan.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3140FC7-B78B-4D8E-B0C8-926D28******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SetupTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetupTableResponseBody(name='body'),
}

/**
 * @param request SetupTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetupTableResponse
 */
async function setupTableWithOptions(request: SetupTableRequest, runtime: $RuntimeOptions): SetupTableResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.allowFullTableScan)) {
    query['AllowFullTableScan'] = request.allowFullTableScan;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetupTable',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SetupTableRequest
 * @return SetupTableResponse
 */
async function setupTable(request: SetupTableRequest): SetupTableResponse {
  var runtime = new $RuntimeOptions{};
  return setupTableWithOptions(request, runtime);
}

model StartRestoreRequest {
  backupDbNames?: string(name='BackupDbNames', description='The name of the database to be restored. Separate multiple databases with commas (,).

>  If you do not specify any database name, all databases in the instance are restored by default.', example='test1,test2'),
  backupId?: string(name='BackupId', description='The ID of the DRDS backup set.

>  If you do not specify this parameter, the system restores data by time (PreferredBackupTime).', example='23***'),
  backupLevel?: string(name='BackupLevel', description='The level of the backup. Valid values:

*   db: The database level.
*   instance: the instance level.', example='db'),
  backupMode?: string(name='BackupMode', description='The backup method. Valid values:

*   logic: the logical backup.
*   phy: fast backup', example='phy'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the DRDS instance.

This parameter is required.', example='rds********'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The restoration time of the instance, in the format of`  yyyy-MM-dd HH:mm:ss `.', example='2019-09-10 20:18:18'),
}

model StartRestoreResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='721C71DD-D3D0-4327-BFDD-678326******'),
  result?: string(name='Result', description='Indicates whether SQL audit was disabled for the DRDS database.', example='success'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model StartRestoreResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartRestoreResponseBody(name='body'),
}

/**
 * @param request StartRestoreRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartRestoreResponse
 */
async function startRestoreWithOptions(request: StartRestoreRequest, runtime: $RuntimeOptions): StartRestoreResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupDbNames)) {
    query['BackupDbNames'] = request.backupDbNames;
  }
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.backupLevel)) {
    query['BackupLevel'] = request.backupLevel;
  }
  if (!$isNull(request.backupMode)) {
    query['BackupMode'] = request.backupMode;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartRestore',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartRestoreRequest
 * @return StartRestoreResponse
 */
async function startRestore(request: StartRestoreRequest): StartRestoreResponse {
  var runtime = new $RuntimeOptions{};
  return startRestoreWithOptions(request, runtime);
}

model SubmitCleanTaskRequest {
  dbName?: string(name='DbName', description='The name of the database that is scaled out.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*********'),
  expandType?: string(name='ExpandType', description='The scale-out type. Valid values:

*   smooth_expand: smooth scale-out
*   hot_expand: hot-spot scale-out

This parameter is required.', example='smooth_expand'),
  jobId?: string(name='JobId', description='The job ID of the scale-out task. The value of this parameter is the same as that of the ParentJobId parameter.

This parameter is required.', example='123'),
  parentJobId?: string(name='ParentJobId', description='The ID of the scale-out task. This parameter is returned if you send a request for the smooth scale-out task.

This parameter is required.', example='123'),
}

model SubmitCleanTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SubmitCleanTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitCleanTaskResponseBody(name='body'),
}

/**
 * @summary Submits a cleanup task for the scale-out of a PolarDB-X database.
 *
 * @param request SubmitCleanTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitCleanTaskResponse
 */
async function submitCleanTaskWithOptions(request: SubmitCleanTaskRequest, runtime: $RuntimeOptions): SubmitCleanTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.expandType)) {
    query['ExpandType'] = request.expandType;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.parentJobId)) {
    query['ParentJobId'] = request.parentJobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitCleanTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a cleanup task for the scale-out of a PolarDB-X database.
 *
 * @param request SubmitCleanTaskRequest
 * @return SubmitCleanTaskResponse
 */
async function submitCleanTask(request: SubmitCleanTaskRequest): SubmitCleanTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitCleanTaskWithOptions(request, runtime);
}

model SubmitHotExpandPreCheckTaskRequest {
  dbInstType?: string(name='DbInstType', description='The type of the database. Valid values:

*   RDS
*   PolarDB

This parameter is required.', example='RDS'),
  dbName?: string(name='DbName', description='The name of the PolarDB-X database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drd*********'),
  tableList?: [ string ](name='TableList', description='The name of the table.', example='test'),
}

model SubmitHotExpandPreCheckTaskResponseBody = {
  msg?: string(name='Msg', description='The result of the task.', example='scucess'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FE104D26-AC19-49B5-AC67-947F69*****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  taskId?: long(name='TaskId', description='The ID of the task.', example='11111'),
}

model SubmitHotExpandPreCheckTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitHotExpandPreCheckTaskResponseBody(name='body'),
}

/**
 * @summary Submits a precheck task for the hot-spot scale-out of a PolarDB-X database. The task is used to check the table that does not contain the primary key.
 *
 * @param request SubmitHotExpandPreCheckTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitHotExpandPreCheckTaskResponse
 */
async function submitHotExpandPreCheckTaskWithOptions(request: SubmitHotExpandPreCheckTaskRequest, runtime: $RuntimeOptions): SubmitHotExpandPreCheckTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.tableList)) {
    query['TableList'] = request.tableList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitHotExpandPreCheckTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a precheck task for the hot-spot scale-out of a PolarDB-X database. The task is used to check the table that does not contain the primary key.
 *
 * @param request SubmitHotExpandPreCheckTaskRequest
 * @return SubmitHotExpandPreCheckTaskResponse
 */
async function submitHotExpandPreCheckTask(request: SubmitHotExpandPreCheckTaskRequest): SubmitHotExpandPreCheckTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitHotExpandPreCheckTaskWithOptions(request, runtime);
}

model SubmitHotExpandTaskRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance.

This parameter is required.', example='drdshbga1138****'),
  extendedMapping?: [ 
    {
      srcDb?: string(name='SrcDb', description='The name of the source physical database.', example='test'),
      srcInstanceId?: string(name='SrcInstanceId', description='The ID of the ApsaraDB RDS instance to which the source physical database belongs.', example='rm-bp1t1mk5a5bdj****'),
    }
  ](name='ExtendedMapping', description='The information about the database on which you want to perform hot-spot scale-out.

This parameter is required.'),
  instanceDbMapping?: [ 
    {
      dbList?: string(name='DbList', description='The name of the hot-spot database.

This parameter is required.', example='hot_test_****_****'),
      instanceName?: string(name='InstanceName', description='The name of the ApsaraDB RDS instance to which the hot-spot database belongs.', example='rm-bp1t1mk5a5bdj****'),
    }
  ](name='InstanceDbMapping', description='The information about the instance to which the hot-spot database belongs.

This parameter is required.'),
  mapping?: [ 
    {
      dbShardColumn?: string(name='DbShardColumn', description='The shard key used to split the database to which the associated table belongs.', example='platform'),
      hotDbName?: string(name='HotDbName', description='The name of the hot-spot database.', example='hot_test_****_****'),
      hotTableName?: string(name='HotTableName', description='The name of the hot-spot table. The name must be prefixed with the name of a logical table.', example='test_table_*****'),
      logicTable?: string(name='LogicTable', description='The name of the logical table on which you want to perform hot-spot scale-out.', example='test_table'),
      shardDbValue?: string(name='ShardDbValue', description='The value of the shard key used to split a database.', example='test'),
      shardTbValue?: string(name='ShardTbValue', description='The value of the shard key used to split a table.', example='test'),
      tbShardColumn?: string(name='TbShardColumn', description='The shard key used to split an associated table.', example='platform'),
    }
  ](name='Mapping', description='The information about the hot-spot database.

This parameter is required.'),
  supperAccountMapping?: [ 
    {
      instanceName?: string(name='InstanceName', description='The ID of the ApsaraDB RDS instance that has the privileged account.', example='rm-bp1t1mk5a5bdj****'),
      supperAccount?: string(name='SupperAccount', description='The name of the privileged account of the ApsaraDB RDS instance.', example='test'),
      supperPassword?: string(name='SupperPassword', description='The password of the privileged account of the ApsaraDB RDS instance.', example='11111111'),
    }
  ](name='SupperAccountMapping', description='The information about the privileged account.'),
  taskDesc?: string(name='TaskDesc', description='The description of the task.', example='test'),
  taskName?: string(name='TaskName', description='The name of the task.', example='test'),
}

model SubmitHotExpandTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B6B7BDC-575D-4A77-A4F8-24B7EFERV45Y'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SubmitHotExpandTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitHotExpandTaskResponseBody(name='body'),
}

/**
 * @summary Submits a hot-spot scale-out task for a database.
 *
 * @param request SubmitHotExpandTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitHotExpandTaskResponse
 */
async function submitHotExpandTaskWithOptions(request: SubmitHotExpandTaskRequest, runtime: $RuntimeOptions): SubmitHotExpandTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.extendedMapping)) {
    query['ExtendedMapping'] = request.extendedMapping;
  }
  if (!$isNull(request.instanceDbMapping)) {
    query['InstanceDbMapping'] = request.instanceDbMapping;
  }
  if (!$isNull(request.mapping)) {
    query['Mapping'] = request.mapping;
  }
  if (!$isNull(request.supperAccountMapping)) {
    query['SupperAccountMapping'] = request.supperAccountMapping;
  }
  if (!$isNull(request.taskDesc)) {
    query['TaskDesc'] = request.taskDesc;
  }
  if (!$isNull(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitHotExpandTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a hot-spot scale-out task for a database.
 *
 * @param request SubmitHotExpandTaskRequest
 * @return SubmitHotExpandTaskResponse
 */
async function submitHotExpandTask(request: SubmitHotExpandTaskRequest): SubmitHotExpandTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitHotExpandTaskWithOptions(request, runtime);
}

model SubmitSmoothExpandPreCheckRequest {
  dbInstType?: string(name='DbInstType', description='The type of the database. Valid values:

*   RDS
*   POLARDB

This parameter is required.', example='RDS'),
  dbName?: string(name='DbName', description='The name of the PolarDB-X database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds*******'),
}

model SubmitSmoothExpandPreCheckResponseBody = {
  msg?: string(name='Msg', description='The result of the precheck task.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FE104D26-AC19-49B5-AC67-947F69******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  taskId?: long(name='TaskId', description='The ID of the precheck task.', example='11111'),
}

model SubmitSmoothExpandPreCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSmoothExpandPreCheckResponseBody(name='body'),
}

/**
 * @summary Submits a precheck task for the smooth scale-out of a PolarDB-X database.
 *
 * @param request SubmitSmoothExpandPreCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSmoothExpandPreCheckResponse
 */
async function submitSmoothExpandPreCheckWithOptions(request: SubmitSmoothExpandPreCheckRequest, runtime: $RuntimeOptions): SubmitSmoothExpandPreCheckResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbInstType)) {
    query['DbInstType'] = request.dbInstType;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitSmoothExpandPreCheck',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a precheck task for the smooth scale-out of a PolarDB-X database.
 *
 * @param request SubmitSmoothExpandPreCheckRequest
 * @return SubmitSmoothExpandPreCheckResponse
 */
async function submitSmoothExpandPreCheck(request: SubmitSmoothExpandPreCheckRequest): SubmitSmoothExpandPreCheckResponse {
  var runtime = new $RuntimeOptions{};
  return submitSmoothExpandPreCheckWithOptions(request, runtime);
}

model SubmitSmoothExpandPreCheckTaskRequest {
  dbName?: string(name='DbName', description='The name of the PolarDB-X 1.0 database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds823s4esd'),
}

model SubmitSmoothExpandPreCheckTaskResponseBody = {
  msg?: string(name='Msg', description='Indicates whether the precheck task was submitted.', example='scucess'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-23ERW'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  taskId?: long(name='TaskId', description='The ID of the task.', example='2321'),
}

model SubmitSmoothExpandPreCheckTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSmoothExpandPreCheckTaskResponseBody(name='body'),
}

/**
 * @summary Submits a precheck task for the smooth scale-out of a PolarDB-X 1.0 database.
 *
 * @param request SubmitSmoothExpandPreCheckTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSmoothExpandPreCheckTaskResponse
 */
async function submitSmoothExpandPreCheckTaskWithOptions(request: SubmitSmoothExpandPreCheckTaskRequest, runtime: $RuntimeOptions): SubmitSmoothExpandPreCheckTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitSmoothExpandPreCheckTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a precheck task for the smooth scale-out of a PolarDB-X 1.0 database.
 *
 * @param request SubmitSmoothExpandPreCheckTaskRequest
 * @return SubmitSmoothExpandPreCheckTaskResponse
 */
async function submitSmoothExpandPreCheckTask(request: SubmitSmoothExpandPreCheckTaskRequest): SubmitSmoothExpandPreCheckTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitSmoothExpandPreCheckTaskWithOptions(request, runtime);
}

model SubmitSqlFlashbackTaskRequest {
  dbName?: string(name='DbName', description='The name of the DRDS database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of a DRDS instance.

This parameter is required.', example='drds*********'),
  endTime?: string(name='EndTime', description='The time when the SQL flashback task ends.

This parameter is required.', example='2019-09-10 23:23:23'),
  recallRestoreType?: int32(name='RecallRestoreType', description='The restoration type. Valid values:

*   1: Image restoration
*   0: reverse recovery

This parameter is required.', example='0'),
  recallType?: int32(name='RecallType', description='Exact match or fuzzy match. Valid values:

*   0: the exact match.
*   1: the fuzzy match.', example='0'),
  sqlPk?: string(name='SqlPk', description='The primary key of flashback SQL.', example='11111'),
  sqlType?: string(name='SqlType', description='The type of the SQL statement. Valid values: INSERT, UPDATE, and DELETE. Separate multiple types with commas (,).', example='INSERT,UPDATE'),
  startTime?: string(name='StartTime', description='The start time of the flashback SQL statement.

This parameter is required.', example='2019-09-10 20:23:23'),
  tableName?: string(name='TableName', description='The name of the table where the flashback SQL operation was performed.', example='test'),
  traceId?: string(name='TraceId', description='The Trace ID of the flashback SQL.', example='ase*****'),
}

model SubmitSqlFlashbackTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='Indicates whether the database creation failure records were removed from the DRDS instance.', example='true'),
  taskId?: long(name='TaskId', description='The ID of the replication task.', example='1111'),
}

model SubmitSqlFlashbackTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSqlFlashbackTaskResponseBody(name='body'),
}

/**
 * @param request SubmitSqlFlashbackTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSqlFlashbackTaskResponse
 */
async function submitSqlFlashbackTaskWithOptions(request: SubmitSqlFlashbackTaskRequest, runtime: $RuntimeOptions): SubmitSqlFlashbackTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.recallRestoreType)) {
    query['RecallRestoreType'] = request.recallRestoreType;
  }
  if (!$isNull(request.recallType)) {
    query['RecallType'] = request.recallType;
  }
  if (!$isNull(request.sqlPk)) {
    query['SqlPk'] = request.sqlPk;
  }
  if (!$isNull(request.sqlType)) {
    query['SqlType'] = request.sqlType;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  if (!$isNull(request.traceId)) {
    query['TraceId'] = request.traceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitSqlFlashbackTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SubmitSqlFlashbackTaskRequest
 * @return SubmitSqlFlashbackTaskResponse
 */
async function submitSqlFlashbackTask(request: SubmitSqlFlashbackTaskRequest): SubmitSqlFlashbackTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitSqlFlashbackTaskWithOptions(request, runtime);
}

model SwitchGlobalBroadcastTypeRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds********'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model SwitchGlobalBroadcastTypeResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the mode of broadcast tables was switched from the multi-write mode to the asynchronous link mode.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SwitchGlobalBroadcastTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchGlobalBroadcastTypeResponseBody(name='body'),
}

/**
 * @summary Switches the mode of broadcast tables from the multi-write mode to the asynchronous link mode.
 *
 * @param request SwitchGlobalBroadcastTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchGlobalBroadcastTypeResponse
 */
async function switchGlobalBroadcastTypeWithOptions(request: SwitchGlobalBroadcastTypeRequest, runtime: $RuntimeOptions): SwitchGlobalBroadcastTypeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchGlobalBroadcastType',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Switches the mode of broadcast tables from the multi-write mode to the asynchronous link mode.
 *
 * @param request SwitchGlobalBroadcastTypeRequest
 * @return SwitchGlobalBroadcastTypeResponse
 */
async function switchGlobalBroadcastType(request: SwitchGlobalBroadcastTypeRequest): SwitchGlobalBroadcastTypeResponse {
  var runtime = new $RuntimeOptions{};
  return switchGlobalBroadcastTypeWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='The ID of the region in which the resource is located.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to INSTANCE.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that you want to add.', example='color'),
      value?: string(name='Value', description='The value of the tag that you want to add.', example='red'),
    }
  ](name='Tag', description='This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FE5D94E3-3C93-3594-95D9-AAED2A980915'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to delete all tags of the resource.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.', example='drds********'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to INSTANCE.

This parameter is required.', example='INSTANCE'),
  tagKey?: [ string ](name='TagKey', example='color'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='Indicates whether the database creation failure records were removed from the DRDS instance.', example='true'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateInstanceNetworkRequest {
  classicExpiredDays?: int32(name='ClassicExpiredDays', description='Specifies the retention period of the classic network endpoint. Unit: days.', example='30'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds******'),
  retainClassic?: boolean(name='RetainClassic', description='Specifies whether to retain the classic network endpoint.', example='true'),
  srcInstanceNetworkType?: string(name='SrcInstanceNetworkType', description='The network type of the PolarDB-X 1.0 instance. Valid values:

*   vpc: Virtual Private Cloud (VPC)
*   classic: classic network

This parameter is required.', example='classic'),
}

model UpdateInstanceNetworkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-*****'),
  success?: boolean(name='Success', description='The result of the request.', example='true'),
}

model UpdateInstanceNetworkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceNetworkResponseBody(name='body'),
}

/**
 * @summary Changes the network type of a PolarDB-X 1.0 instance.
 *
 * @param request UpdateInstanceNetworkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceNetworkResponse
 */
async function updateInstanceNetworkWithOptions(request: UpdateInstanceNetworkRequest, runtime: $RuntimeOptions): UpdateInstanceNetworkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.classicExpiredDays)) {
    query['ClassicExpiredDays'] = request.classicExpiredDays;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.retainClassic)) {
    query['RetainClassic'] = request.retainClassic;
  }
  if (!$isNull(request.srcInstanceNetworkType)) {
    query['SrcInstanceNetworkType'] = request.srcInstanceNetworkType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateInstanceNetwork',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the network type of a PolarDB-X 1.0 instance.
 *
 * @param request UpdateInstanceNetworkRequest
 * @return UpdateInstanceNetworkResponse
 */
async function updateInstanceNetwork(request: UpdateInstanceNetworkRequest): UpdateInstanceNetworkResponse {
  var runtime = new $RuntimeOptions{};
  return updateInstanceNetworkWithOptions(request, runtime);
}

model UpdatePrivateRdsClassRequest {
  autoUseCoupon?: boolean(name='AutoUseCoupon', description='Specifies whether to use vouchers to offset the purchase fees. Valid values: **true** and **false**. Default value: false.

> If you downgrade the specifications of an instance after you use the vouchers, the vouchers used for the purchase cannot be refunded.', example='true'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the custom ApsaraDB RDS instance at the storage layer.

> You can call the [DescribeDrdsRdsInstances](~~xxxx~~) operation to query the details of all ApsaraDB RDS instances at the storage layer of a PolarDB-X 1.0 instance, including the IDs of the ApsaraDB RDS instances.

This parameter is required.', example='rm-***************'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

> You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to query the details of all PolarDB-X 1.0 instances within an Alibaba Cloud account, including the IDs of the instances.

This parameter is required.', example='drds*************'),
  prePayDuration?: int32(name='PrePayDuration', description='This parameter is discontinued.', example='12'),
  rdsClass?: string(name='RdsClass', description='The new instance type of the custom ApsaraDB RDS instance at the storage layer.

> You can call the [DescribeAvailableClasses](https://help.aliyun.com/document_detail/196546.html) operation to view the specifications that are supported for a custom ApsaraDB RDS instance. The specifications include the instance type and the storage capacity.', example='rds.mysql.c1.xlarge'),
  storage?: string(name='Storage', description='The new storage capacity of the custom ApsaraDB RDS instance at the storage layer.

> You can call the [DescribeAvailableClasses](https://help.aliyun.com/document_detail/196546.html) operation to view the specifications that are supported for a custom ApsaraDB RDS instance. The specifications include the instance type and the storage capacity.', example='50'),
}

model UpdatePrivateRdsClassResponseBody = {
  data?: string(name='Data', description='The ID of the order.', example='{     "orderId": "209136011******"   }'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='57D86AB4-8703-4DF4-BAB6-F7DE44******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model UpdatePrivateRdsClassResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePrivateRdsClassResponseBody(name='body'),
}

/**
 * @summary Updates the specifications of a custom ApsaraDB RDS instance at the storage layer.
 *
 * @param request UpdatePrivateRdsClassRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePrivateRdsClassResponse
 */
async function updatePrivateRdsClassWithOptions(request: UpdatePrivateRdsClassRequest, runtime: $RuntimeOptions): UpdatePrivateRdsClassResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.prePayDuration)) {
    query['PrePayDuration'] = request.prePayDuration;
  }
  if (!$isNull(request.rdsClass)) {
    query['RdsClass'] = request.rdsClass;
  }
  if (!$isNull(request.storage)) {
    query['Storage'] = request.storage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePrivateRdsClass',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the specifications of a custom ApsaraDB RDS instance at the storage layer.
 *
 * @param request UpdatePrivateRdsClassRequest
 * @return UpdatePrivateRdsClassResponse
 */
async function updatePrivateRdsClass(request: UpdatePrivateRdsClassRequest): UpdatePrivateRdsClassResponse {
  var runtime = new $RuntimeOptions{};
  return updatePrivateRdsClassWithOptions(request, runtime);
}

model UpdateResourceGroupAttributeRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the instance that you want to transfer.

>  You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to view the details of the instances under the account, including the instance IDs.

This parameter is required.', example='drds***********'),
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the resource group that you want to specify.

>  You can call the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation to view the details of the resource groups, including the resource group IDs.

This parameter is required.', example='rg-***************'),
  regionId?: string(name='RegionId', description='The ID of the region where the instance you want to transfer is located.

>  You can call the [DescribeDrdsInstances](https://help.aliyun.com/document_detail/139284.html) operation to view the details of the instances under the account, including the region IDs.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateResourceGroupAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='91C7CAB5-3B2E-4FB6-893C-0162C0******'),
}

model UpdateResourceGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResourceGroupAttributeResponseBody(name='body'),
}

/**
 * @param request UpdateResourceGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResourceGroupAttributeResponse
 */
async function updateResourceGroupAttributeWithOptions(request: UpdateResourceGroupAttributeRequest, runtime: $RuntimeOptions): UpdateResourceGroupAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateResourceGroupAttribute',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateResourceGroupAttributeRequest
 * @return UpdateResourceGroupAttributeResponse
 */
async function updateResourceGroupAttribute(request: UpdateResourceGroupAttributeRequest): UpdateResourceGroupAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateResourceGroupAttributeWithOptions(request, runtime);
}

model UpgradeHiStoreInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drdssad23sdfc'),
  historeInstanceId?: string(name='HistoreInstanceId', description='The ID of the column-oriented storage instance.

This parameter is required.', example='hi-sesex2e'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model UpgradeHiStoreInstanceResponseBody = {
  data?: string(name='Data', description='Indicates whether the request was successful. A value of true indicates that the request was successful. An error message was returned if the request failed.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DSSDF-SEWE-23ERW'),
}

model UpgradeHiStoreInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeHiStoreInstanceResponseBody(name='body'),
}

/**
 * @summary Upgrades the version of a column-oriented storage instance of a PolarDB-X 1.0 instance.
 *
 * @param request UpgradeHiStoreInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeHiStoreInstanceResponse
 */
async function upgradeHiStoreInstanceWithOptions(request: UpgradeHiStoreInstanceRequest, runtime: $RuntimeOptions): UpgradeHiStoreInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.historeInstanceId)) {
    query['HistoreInstanceId'] = request.historeInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpgradeHiStoreInstance',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades the version of a column-oriented storage instance of a PolarDB-X 1.0 instance.
 *
 * @param request UpgradeHiStoreInstanceRequest
 * @return UpgradeHiStoreInstanceResponse
 */
async function upgradeHiStoreInstance(request: UpgradeHiStoreInstanceRequest): UpgradeHiStoreInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return upgradeHiStoreInstanceWithOptions(request, runtime);
}

model UpgradeInstanceVersionRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance that you want to upgrade.

This parameter is required.', example='drdshbgaen89****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  rpm?: string(name='Rpm', description='The version number of the PolarDB-X 1.0 instance. You can leave this parameter unspecified.', example='t-drds-server-5.4.12-16348095.noarch.rpm'),
}

model UpgradeInstanceVersionResponseBody = {
  data?: string(name='Data', description='The result of the request.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F7F8080-9132-4279-85D0-B7E5C4305162'),
}

model UpgradeInstanceVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeInstanceVersionResponseBody(name='body'),
}

/**
 * @param request UpgradeInstanceVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeInstanceVersionResponse
 */
async function upgradeInstanceVersionWithOptions(request: UpgradeInstanceVersionRequest, runtime: $RuntimeOptions): UpgradeInstanceVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.rpm)) {
    query['Rpm'] = request.rpm;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpgradeInstanceVersion',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpgradeInstanceVersionRequest
 * @return UpgradeInstanceVersionResponse
 */
async function upgradeInstanceVersion(request: UpgradeInstanceVersionRequest): UpgradeInstanceVersionResponse {
  var runtime = new $RuntimeOptions{};
  return upgradeInstanceVersionWithOptions(request, runtime);
}

model ValidateShardTaskRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='The ID of the PolarDB-X 1.0 instance.

This parameter is required.', example='drds23ds****'),
  regionId?: string(name='RegionId', description='The ID of the region where the PolarDB-X 1.0 instance is created.', example='cn-hangzhou'),
  sourceTableName?: string(name='SourceTableName', description='The name of the table or table shard on which you want to perform the task.

This parameter is required.', example='buyer'),
  targetTableName?: string(name='TargetTableName', description='The name of the table or table shard on which you perform the task.

This parameter is required.', example='buyer_new'),
  taskType?: string(name='TaskType', description='The type of the task. Valid values:

*   **SINGLE_TO_SHARD**: converts a single table to a table shard.
*   **SHARD_TO_SINGLE**: converts a table shard to a single table.
*   **SHARD_TO_SHARD**: converts a table shard to another table shard.

This parameter is required.', example='SINGLE_TO_SHARD'),
}

model ValidateShardTaskResponseBody = {
  list?: [ 
    {
      item?: string(name='Item', description='Indicates the name of a check item.', example='same_schema'),
      result?: int32(name='Result', description='Indicates the result of the check item. Valid values:

*   **0**: indicates the task is valid.
*   **1**: indicates the task is invalid.', example='0'),
    }
  ](name='List', description='Indicates the check results.'),
  requestId?: string(name='RequestId', description='Indicates the ID of the request.', example='0B6B7BDC-575D-4A77-A4F8-24B7EFAS45FG'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.', example='true'),
}

model ValidateShardTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidateShardTaskResponseBody(name='body'),
}

/**
 * @param request ValidateShardTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ValidateShardTaskResponse
 */
async function validateShardTaskWithOptions(request: ValidateShardTaskRequest, runtime: $RuntimeOptions): ValidateShardTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sourceTableName)) {
    query['SourceTableName'] = request.sourceTableName;
  }
  if (!$isNull(request.targetTableName)) {
    query['TargetTableName'] = request.targetTableName;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ValidateShardTask',
    version = '2019-01-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ValidateShardTaskRequest
 * @return ValidateShardTaskResponse
 */
async function validateShardTask(request: ValidateShardTaskRequest): ValidateShardTaskResponse {
  var runtime = new $RuntimeOptions{};
  return validateShardTaskWithOptions(request, runtime);
}

